]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
power: supply: core: introduce power_supply_has_property()
authorThomas Weißschuh <linux@weissschuh.net>
Mon, 11 Nov 2024 21:40:05 +0000 (22:40 +0100)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Wed, 4 Dec 2024 23:02:31 +0000 (00:02 +0100)
commitaa40f37d636570458e1be76f51564357347eb77c
treee080a8a55b4958234f609d19f1a1cc2eec35aa9c
parent172f2151c2b436746173d794887115e026961d82
power: supply: core: introduce power_supply_has_property()

Introduce a helper to check if a power supply implements a certain
property. It will be used by the sysfs and hwmon code to remove similar
open-coded checks.
It also paves the way for the extension API to hook into.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Armin Wolf <W_Armin@gmx.de>
Link: https://lore.kernel.org/r/20241111-power-supply-extensions-v4-3-7240144daa8e@weissschuh.net
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/power_supply.h
drivers/power/supply/power_supply_core.c