Commit 29e9eff4 authored by Lubomir Rintel's avatar Lubomir Rintel Committed by Sebastian Reichel

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 648cd48c ("hwmon: Do not accept invalid name
attributes") and commit 74d3b641 ("hwmon: Relax name attribute
validation for new APIs").
Signed-off-by: default avatarLubomir Rintel <lkundrak@v3.sk>
Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
parent fa7cc725
...@@ -52,7 +52,7 @@ static const char * const lid_wake_mode_names[] = { ...@@ -52,7 +52,7 @@ static const char * const lid_wake_mode_names[] = {
static void battery_status_changed(void) static void battery_status_changed(void)
{ {
struct power_supply *psy = power_supply_get_by_name("olpc-battery"); struct power_supply *psy = power_supply_get_by_name("olpc_battery");
if (psy) { if (psy) {
power_supply_changed(psy); power_supply_changed(psy);
...@@ -62,7 +62,7 @@ static void battery_status_changed(void) ...@@ -62,7 +62,7 @@ static void battery_status_changed(void)
static void ac_status_changed(void) static void ac_status_changed(void)
{ {
struct power_supply *psy = power_supply_get_by_name("olpc-ac"); struct power_supply *psy = power_supply_get_by_name("olpc_ac");
if (psy) { if (psy) {
power_supply_changed(psy); power_supply_changed(psy);
......
...@@ -75,7 +75,7 @@ static struct kobj_attribute lid_wake_on_close_attr = ...@@ -75,7 +75,7 @@ static struct kobj_attribute lid_wake_on_close_attr =
static void battery_status_changed(void) static void battery_status_changed(void)
{ {
struct power_supply *psy = power_supply_get_by_name("olpc-battery"); struct power_supply *psy = power_supply_get_by_name("olpc_battery");
if (psy) { if (psy) {
power_supply_changed(psy); power_supply_changed(psy);
...@@ -85,7 +85,7 @@ static void battery_status_changed(void) ...@@ -85,7 +85,7 @@ static void battery_status_changed(void)
static void ac_status_changed(void) static void ac_status_changed(void)
{ {
struct power_supply *psy = power_supply_get_by_name("olpc-ac"); struct power_supply *psy = power_supply_get_by_name("olpc_ac");
if (psy) { if (psy) {
power_supply_changed(psy); power_supply_changed(psy);
......
...@@ -410,7 +410,7 @@ static void olpc_xo175_ec_complete(void *arg) ...@@ -410,7 +410,7 @@ static void olpc_xo175_ec_complete(void *arg)
dev_dbg(dev, "got event %.2x\n", byte); dev_dbg(dev, "got event %.2x\n", byte);
switch (byte) { switch (byte) {
case EVENT_AC_CHANGE: case EVENT_AC_CHANGE:
psy = power_supply_get_by_name("olpc-ac"); psy = power_supply_get_by_name("olpc_ac");
if (psy) { if (psy) {
power_supply_changed(psy); power_supply_changed(psy);
power_supply_put(psy); power_supply_put(psy);
...@@ -420,7 +420,7 @@ static void olpc_xo175_ec_complete(void *arg) ...@@ -420,7 +420,7 @@ static void olpc_xo175_ec_complete(void *arg)
case EVENT_BATTERY_CRITICAL: case EVENT_BATTERY_CRITICAL:
case EVENT_BATTERY_SOC_CHANGE: case EVENT_BATTERY_SOC_CHANGE:
case EVENT_BATTERY_ERROR: case EVENT_BATTERY_ERROR:
psy = power_supply_get_by_name("olpc-battery"); psy = power_supply_get_by_name("olpc_battery");
if (psy) { if (psy) {
power_supply_changed(psy); power_supply_changed(psy);
power_supply_put(psy); power_supply_put(psy);
......
...@@ -88,7 +88,7 @@ static enum power_supply_property olpc_ac_props[] = { ...@@ -88,7 +88,7 @@ static enum power_supply_property olpc_ac_props[] = {
}; };
static const struct power_supply_desc olpc_ac_desc = { static const struct power_supply_desc olpc_ac_desc = {
.name = "olpc-ac", .name = "olpc_ac",
.type = POWER_SUPPLY_TYPE_MAINS, .type = POWER_SUPPLY_TYPE_MAINS,
.properties = olpc_ac_props, .properties = olpc_ac_props,
.num_properties = ARRAY_SIZE(olpc_ac_props), .num_properties = ARRAY_SIZE(olpc_ac_props),
...@@ -605,7 +605,7 @@ static const struct attribute_group *olpc_bat_sysfs_groups[] = { ...@@ -605,7 +605,7 @@ static const struct attribute_group *olpc_bat_sysfs_groups[] = {
*********************************************************************/ *********************************************************************/
static struct power_supply_desc olpc_bat_desc = { static struct power_supply_desc olpc_bat_desc = {
.name = "olpc-battery", .name = "olpc_battery",
.get_property = olpc_bat_get_property, .get_property = olpc_bat_get_property,
.use_for_apm = 1, .use_for_apm = 1,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment