]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
power: supply: sysfs: use power_supply_property_is_writeable()
authorThomas Weißschuh <linux@weissschuh.net>
Sat, 8 Jun 2024 19:19:37 +0000 (21:19 +0200)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Thu, 4 Jul 2024 10:30:49 +0000 (12:30 +0200)
Instead of open-coding the helper use it directly.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Link: https://lore.kernel.org/r/20240608-power-supply-extensions-v2-1-2dcd35b012ad@weissschuh.net
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/power_supply_sysfs.c

index b86e11bdc07ef8d6bbdb2702ea10982b8a06d27c..3e63d165b2f70cf6854671b000b4ea81fadefa6d 100644 (file)
@@ -379,8 +379,7 @@ static umode_t power_supply_attr_is_visible(struct kobject *kobj,
                int property = psy->desc->properties[i];
 
                if (property == attrno) {
-                       if (psy->desc->property_is_writeable &&
-                           psy->desc->property_is_writeable(psy, property) > 0)
+                       if (power_supply_property_is_writeable(psy, property) > 0)
                                mode |= S_IWUSR;
 
                        return mode;