Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

power: supply: olpc_battery: fix the power supply name

The framework is unhappy about them, because it uses the names in sysfs
attributes:

power_supply olpc-ac: hwmon: 'olpc-ac' is not a valid name attribute, please fix
power_supply olpc-battery: hwmon: 'olpc-battery' is not a valid name attribute, please fix

See also commit 648cd48c9e56 ("hwmon: Do not accept invalid name
attributes") and commit 74d3b6419772 ("hwmon: Relax name attribute
validation for new APIs").

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>

authored by

Lubomir Rintel and committed by
Sebastian Reichel
29e9eff4 fa7cc725

+8 -8
+2 -2
arch/x86/platform/olpc/olpc-xo1-sci.c
··· 52 52 53 53 static void battery_status_changed(void) 54 54 { 55 - struct power_supply *psy = power_supply_get_by_name("olpc-battery"); 55 + struct power_supply *psy = power_supply_get_by_name("olpc_battery"); 56 56 57 57 if (psy) { 58 58 power_supply_changed(psy); ··· 62 62 63 63 static void ac_status_changed(void) 64 64 { 65 - struct power_supply *psy = power_supply_get_by_name("olpc-ac"); 65 + struct power_supply *psy = power_supply_get_by_name("olpc_ac"); 66 66 67 67 if (psy) { 68 68 power_supply_changed(psy);
+2 -2
arch/x86/platform/olpc/olpc-xo15-sci.c
··· 75 75 76 76 static void battery_status_changed(void) 77 77 { 78 - struct power_supply *psy = power_supply_get_by_name("olpc-battery"); 78 + struct power_supply *psy = power_supply_get_by_name("olpc_battery"); 79 79 80 80 if (psy) { 81 81 power_supply_changed(psy); ··· 85 85 86 86 static void ac_status_changed(void) 87 87 { 88 - struct power_supply *psy = power_supply_get_by_name("olpc-ac"); 88 + struct power_supply *psy = power_supply_get_by_name("olpc_ac"); 89 89 90 90 if (psy) { 91 91 power_supply_changed(psy);
+2 -2
drivers/platform/olpc/olpc-xo175-ec.c
··· 410 410 dev_dbg(dev, "got event %.2x\n", byte); 411 411 switch (byte) { 412 412 case EVENT_AC_CHANGE: 413 - psy = power_supply_get_by_name("olpc-ac"); 413 + psy = power_supply_get_by_name("olpc_ac"); 414 414 if (psy) { 415 415 power_supply_changed(psy); 416 416 power_supply_put(psy); ··· 420 420 case EVENT_BATTERY_CRITICAL: 421 421 case EVENT_BATTERY_SOC_CHANGE: 422 422 case EVENT_BATTERY_ERROR: 423 - psy = power_supply_get_by_name("olpc-battery"); 423 + psy = power_supply_get_by_name("olpc_battery"); 424 424 if (psy) { 425 425 power_supply_changed(psy); 426 426 power_supply_put(psy);
+2 -2
drivers/power/supply/olpc_battery.c
··· 88 88 }; 89 89 90 90 static const struct power_supply_desc olpc_ac_desc = { 91 - .name = "olpc-ac", 91 + .name = "olpc_ac", 92 92 .type = POWER_SUPPLY_TYPE_MAINS, 93 93 .properties = olpc_ac_props, 94 94 .num_properties = ARRAY_SIZE(olpc_ac_props), ··· 605 605 *********************************************************************/ 606 606 607 607 static struct power_supply_desc olpc_bat_desc = { 608 - .name = "olpc-battery", 608 + .name = "olpc_battery", 609 609 .get_property = olpc_bat_get_property, 610 610 .use_for_apm = 1, 611 611 };