[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240204-power_supply-charge_behaviour_prop-v1-4-06a20c958f96@weissschuh.net>
Date: Sun, 04 Feb 2024 18:26:50 +0100
From: Thomas Weißschuh <linux@...ssschuh.net>
To: Sebastian Reichel <sre@...nel.org>, Hans de Goede <hdegoede@...hat.com>,
Konrad Dybcio <konradybcio@...nel.org>
Cc: linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org,
Sebastian Reichel <sebastian.reichel@...labora.com>,
Thomas Weißschuh <linux@...ssschuh.net>
Subject: [PATCH 4/4] power: supply: core: drop workaround for missing
POWER_SUPPLY_PROP_CHARGE_BEHAVIOUR_AVAILABLE
As the mm8013 driver was extended to also report that property the
workaround is not needed anymore.
Signed-off-by: Thomas Weißschuh <linux@...ssschuh.net>
---
drivers/power/supply/power_supply_sysfs.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/power/supply/power_supply_sysfs.c b/drivers/power/supply/power_supply_sysfs.c
index 3680cfc2e908..3804a3bbed24 100644
--- a/drivers/power/supply/power_supply_sysfs.c
+++ b/drivers/power/supply/power_supply_sysfs.c
@@ -273,7 +273,6 @@ static ssize_t power_supply_show_usb_type(struct device *dev,
static ssize_t power_supply_show_charge_behaviour(struct device *dev,
struct power_supply *psy,
- struct power_supply_attr *ps_attr,
union power_supply_propval *value,
char *buf)
{
@@ -289,9 +288,7 @@ static ssize_t power_supply_show_charge_behaviour(struct device *dev,
ret = power_supply_get_property(psy,
POWER_SUPPLY_PROP_CHARGE_BEHAVIOUR_AVAILABLE,
&available);
- if (ret == -EINVAL)
- return sysfs_emit(buf, "%s\n", ps_attr->text_values[value->intval]);
- else if (ret < 0)
+ if (ret < 0)
return ret;
return power_supply_charge_behaviour_show(dev, available.intval, value->intval, buf);
@@ -337,8 +334,7 @@ static ssize_t power_supply_show_property(struct device *dev,
&value, buf);
break;
case POWER_SUPPLY_PROP_CHARGE_BEHAVIOUR:
- ret = power_supply_show_charge_behaviour(dev, psy, ps_attr,
- &value, buf);
+ ret = power_supply_show_charge_behaviour(dev, psy, &value, buf);
break;
case POWER_SUPPLY_PROP_MODEL_NAME ... POWER_SUPPLY_PROP_SERIAL_NUMBER:
ret = sysfs_emit(buf, "%s\n", value.strval);
--
2.43.0
Powered by blists - more mailing lists