Skip to contentSkip to conversation

power_supply: don't export power_supply_notifier

PATCH In review Johannes Berg 2 participants 2 messages Feb 21, 2014 – Feb 25, 2014 Power supply

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 power_supply: don't export power_supply_notifier

From: Johannes Berg <[email protected]>

Since there are registration/unregistration functions and the invocation is in the core code, there's no need to export the notifier chain head, make it static instead.

---
This should probably go into 3.14 so it's not exported in the release.

---
 drivers/power/power_supply_core.c | 3 +--
 include/linux/power_supply.h      | 1 -
 2 files changed, 1 insertion(+), 3 deletions(-)
drivers/power/power_supply_core.c +1 -2
index 26606641fe44..31a105235c3e 100644
@@ -25,8 +25,7 @@
 struct class *power_supply_class;
 EXPORT_SYMBOL_GPL(power_supply_class);
 
-ATOMIC_NOTIFIER_HEAD(power_supply_notifier);
-EXPORT_SYMBOL_GPL(power_supply_notifier);
+static ATOMIC_NOTIFIER_HEAD(power_supply_notifier);
 
 static struct device_type power_supply_dev_type;
 
include/linux/power_supply.h +0 -1
index c9dc4e09854c..80968ee25940 100644
@@ -240,7 +240,6 @@ struct power_supply_info {
 	int use_for_apm;
 };
 
-extern struct atomic_notifier_head power_supply_notifier;
 extern int power_supply_reg_notifier(struct notifier_block *nb);
 extern void power_supply_unreg_notifier(struct notifier_block *nb);
 extern struct power_supply *power_supply_get_by_name(const char *name);
Signature · 1 line
1.8.5.3
#1 lore raw
Quoted 5 lines · Johannes Berg

From: Johannes Berg <[email protected]>

Since there are registration/unregistration functions and the invocation is in the core code, there's no need to export the notifier chain head, make it static instead.

This is a generic notifier which can be used outside power_supply_core.c to post psy events as in patch power_supply-Introduce-generic-psy-charging-driver.patch. So the notifier chain need to be exported.