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>
This commit is contained in:

committed by
Sebastian Reichel

parent
efcca6bdfb
commit
157ba1bb5f
@@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user