aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/power
diff options
context:
space:
mode:
authorSebastian Reichel <sebastian.reichel@collabora.com>2018-09-28 17:35:37 +0200
committerSebastian Reichel <sre@kernel.org>2018-12-13 00:16:20 +0100
commit157ba1bb5fcb91366df3be5e63a04b799ff9cf64 (patch)
treeefbb8664aa84ad60a9520966df63e0574bd44ca1 /include/linux/power
parentpower: supply: charger-manager: simplify generation of sysfs attribute group name (diff)
downloadwireguard-linux-157ba1bb5fcb91366df3be5e63a04b799ff9cf64.tar.xz
wireguard-linux-157ba1bb5fcb91366df3be5e63a04b799ff9cf64.zip
power: supply: charger-manager: fix race-condition in sysfs registration
This registers custom sysfs properties using the native functionality of the power-supply framework, which cleans up the code a bit and fixes a race-condition. Before this patch the sysfs attributes were not properly registered to udev. Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'include/linux/power')
-rw-r--r--include/linux/power/charger-manager.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/power/charger-manager.h b/include/linux/power/charger-manager.h
index c4fa907c8f14..2ce8d00c20de 100644
--- a/include/linux/power/charger-manager.h
+++ b/include/linux/power/charger-manager.h
@@ -119,7 +119,7 @@ struct charger_regulator {
struct charger_cable *cables;
int num_cables;
- struct attribute_group attr_g;
+ struct attribute_group attr_grp;
struct device_attribute attr_name;
struct device_attribute attr_state;
struct device_attribute attr_externally_control;
@@ -186,6 +186,7 @@ struct charger_desc {
int num_charger_regulators;
struct charger_regulator *charger_regulators;
+ const struct attribute_group **sysfs_groups;
const char *psy_fuel_gauge;