power: supply: core: Use blocking_notifier_call_chain to avoid RCU complaint
[platform/kernel/linux-rpi.git] / drivers / power / supply / power_supply_core.c
index 0b69fb7..416409e 100644 (file)
@@ -29,7 +29,7 @@
 struct class *power_supply_class;
 EXPORT_SYMBOL_GPL(power_supply_class);
 
-ATOMIC_NOTIFIER_HEAD(power_supply_notifier);
+BLOCKING_NOTIFIER_HEAD(power_supply_notifier);
 EXPORT_SYMBOL_GPL(power_supply_notifier);
 
 static struct device_type power_supply_dev_type;
@@ -97,7 +97,7 @@ static void power_supply_changed_work(struct work_struct *work)
                class_for_each_device(power_supply_class, NULL, psy,
                                      __power_supply_changed_work);
                power_supply_update_leds(psy);
-               atomic_notifier_call_chain(&power_supply_notifier,
+               blocking_notifier_call_chain(&power_supply_notifier,
                                PSY_EVENT_PROP_CHANGED, psy);
                kobject_uevent(&psy->dev.kobj, KOBJ_CHANGE);
                spin_lock_irqsave(&psy->changed_lock, flags);
@@ -1262,13 +1262,13 @@ static void power_supply_dev_release(struct device *dev)
 
 int power_supply_reg_notifier(struct notifier_block *nb)
 {
-       return atomic_notifier_chain_register(&power_supply_notifier, nb);
+       return blocking_notifier_chain_register(&power_supply_notifier, nb);
 }
 EXPORT_SYMBOL_GPL(power_supply_reg_notifier);
 
 void power_supply_unreg_notifier(struct notifier_block *nb)
 {
-       atomic_notifier_chain_unregister(&power_supply_notifier, nb);
+       blocking_notifier_chain_unregister(&power_supply_notifier, nb);
 }
 EXPORT_SYMBOL_GPL(power_supply_unreg_notifier);