]> git.baikalelectronics.ru Git - kernel.git/commit
power: supply: core: Add a macro that maps enum properties to text values
authorMathew King <mathewk@chromium.org>
Mon, 4 May 2020 20:29:29 +0000 (14:29 -0600)
committerSebastian Reichel <sre@kernel.org>
Wed, 6 May 2020 22:53:57 +0000 (00:53 +0200)
commit334c0f894354b921e6a4a9b79fe4869953247291
treefb4998916f752d71f2298d82ef4843c8dd330ed4
parent3952f34c2516ae8007823aee48583fd16e49c294
power: supply: core: Add a macro that maps enum properties to text values

Reduce the number of touch points to add a new enum property to the
power_supply class by mapping the array of text values to the device
attribute descriptor. A new enum property can now added by creating an
array with the text values named POWER_SUPPLY_${PROPNAME}_TEXT and
adding POWER_SUPPLY_ENUM_ATTR(${PROPNAME}) to the power_supply_attrs
array.

Signed-off-by: Mathew King <mathewk@chromium.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/power_supply_sysfs.c