diff options
author | Anton Vorontsov <cbouatmailru@gmail.com> | 2010-05-18 15:49:51 -0400 |
---|---|---|
committer | Anton Vorontsov <cbouatmailru@gmail.com> | 2010-05-19 04:14:28 -0400 |
commit | 5f487cd34f4337f9bc27ca19da72a39d1b0a0ab4 (patch) | |
tree | f3204e0cf64a7202c42d1f397fd978ccd61f8225 /drivers/power/power_supply.h | |
parent | a1e50fd4452b2ed57376ece465a17276b59fad9c (diff) |
power_supply: Use attribute groups
This fixes a race between power supply device and initial
attributes creation, plus makes it possible to implement
writable properties.
[Daniel Mack - removed superflous return statement
and dropped .mode attribute from POWER_SUPPLY_ATTR]
Suggested-by: Greg KH <gregkh@suse.de>
Suggested-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
Tested-by: Daniel Mack <daniel@caiaq.de>
Diffstat (limited to 'drivers/power/power_supply.h')
-rw-r--r-- | drivers/power/power_supply.h | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/power/power_supply.h b/drivers/power/power_supply.h index f38ba482be75..018de2b26998 100644 --- a/drivers/power/power_supply.h +++ b/drivers/power/power_supply.h | |||
@@ -12,15 +12,12 @@ | |||
12 | 12 | ||
13 | #ifdef CONFIG_SYSFS | 13 | #ifdef CONFIG_SYSFS |
14 | 14 | ||
15 | extern int power_supply_create_attrs(struct power_supply *psy); | 15 | extern void power_supply_init_attrs(struct device_type *dev_type); |
16 | extern void power_supply_remove_attrs(struct power_supply *psy); | ||
17 | extern int power_supply_uevent(struct device *dev, struct kobj_uevent_env *env); | 16 | extern int power_supply_uevent(struct device *dev, struct kobj_uevent_env *env); |
18 | 17 | ||
19 | #else | 18 | #else |
20 | 19 | ||
21 | static inline int power_supply_create_attrs(struct power_supply *psy) | 20 | static inline void power_supply_init_attrs(struct device_type *dev_type) {} |
22 | { return 0; } | ||
23 | static inline void power_supply_remove_attrs(struct power_supply *psy) {} | ||
24 | #define power_supply_uevent NULL | 21 | #define power_supply_uevent NULL |
25 | 22 | ||
26 | #endif /* CONFIG_SYSFS */ | 23 | #endif /* CONFIG_SYSFS */ |