[RFC PATCH 4/4] max17042_battery: Change battery name instead of static name according to device type

From: Chanwoo Choi
Date: Mon Mar 17 2014 - 08:47:23 EST


This patch use device name to make power_supply path according to device type:

[Before]
In case of max17042/max17047/max17050,
- /sys/class/power_supply/max170xx_battery

[After]
In case of max17042,
- /sys/class/power_supply/max17042
In case of max17047,
- /sys/class/power_supply/max17047
In case of max17050,
- /sys/class/power_supply/max17050

Signed-off-by: Chanwoo Choi <cw00.choi@xxxxxxxxxxx>
---
drivers/power/max17042_battery.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/power/max17042_battery.c b/drivers/power/max17042_battery.c
index 66da691..cba6def 100644
--- a/drivers/power/max17042_battery.c
+++ b/drivers/power/max17042_battery.c
@@ -707,7 +707,7 @@ static int max17042_probe(struct i2c_client *client,
return -EIO;
}

- chip->battery.name = "max170xx_battery";
+ chip->battery.name = client->name;
chip->battery.type = POWER_SUPPLY_TYPE_BATTERY;
chip->battery.get_property = max17042_get_property;
chip->battery.properties = max17042_battery_props;
--
1.8.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/