mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 18:41:58 +09:00
Revert "FROMLIST: power_supply: Register cooling device outside of probe"
This reverts commit 2d80f682ca.
It causes merge conflicts with the upstream release of 5.15.99 as the
code it modifies is removed entirely there as it is buggy.
If this really needs to come back, please resubmit it in a way that can
work properly.
Bug: 211709650
Cc: Manaf Meethalavalappu Pallikunhi <quic_manafm@quicinc.com>
Change-Id: Ice34a04f94e416a04d70f116c212fd1e86cf5567
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
@@ -132,7 +132,6 @@ void power_supply_changed(struct power_supply *psy)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(power_supply_changed);
|
||||
|
||||
static int psy_register_cooler(struct power_supply *psy);
|
||||
/*
|
||||
* Notify that power supply was registered after parent finished the probing.
|
||||
*
|
||||
@@ -140,8 +139,6 @@ static int psy_register_cooler(struct power_supply *psy);
|
||||
* calling power_supply_changed() directly from power_supply_register()
|
||||
* would lead to execution of get_property() function provided by the driver
|
||||
* too early - before the probe ends.
|
||||
* Also, registering cooling device from the probe will execute the
|
||||
* get_property() function. So register the cooling device after the probe.
|
||||
*
|
||||
* Avoid that by waiting on parent's mutex.
|
||||
*/
|
||||
@@ -159,7 +156,6 @@ static void power_supply_deferred_register_work(struct work_struct *work)
|
||||
}
|
||||
|
||||
power_supply_changed(psy);
|
||||
psy_register_cooler(psy);
|
||||
|
||||
if (psy->dev.parent)
|
||||
mutex_unlock(&psy->dev.parent->mutex);
|
||||
@@ -1276,6 +1272,10 @@ __power_supply_register(struct device *parent,
|
||||
if (rc)
|
||||
goto register_thermal_failed;
|
||||
|
||||
rc = psy_register_cooler(psy);
|
||||
if (rc)
|
||||
goto register_cooler_failed;
|
||||
|
||||
rc = power_supply_create_triggers(psy);
|
||||
if (rc)
|
||||
goto create_triggers_failed;
|
||||
@@ -1305,6 +1305,8 @@ __power_supply_register(struct device *parent,
|
||||
add_hwmon_sysfs_failed:
|
||||
power_supply_remove_triggers(psy);
|
||||
create_triggers_failed:
|
||||
psy_unregister_cooler(psy);
|
||||
register_cooler_failed:
|
||||
psy_unregister_thermal(psy);
|
||||
register_thermal_failed:
|
||||
wakeup_init_failed:
|
||||
|
||||
Reference in New Issue
Block a user