]> git.baikalelectronics.ru Git - kernel.git/commit
power: supply: sysfs: parse string as enum when writing property
authorDavid Lechner <david@lechnology.com>
Mon, 15 May 2017 21:21:15 +0000 (16:21 -0500)
committerSebastian Reichel <sre@kernel.org>
Thu, 8 Jun 2017 11:05:27 +0000 (13:05 +0200)
commit90a0d8a3bf9589b67eb898c019d3601ab2810687
treea78c2aa2e0dbf22303c74412de68ce5657713346
parentbaa102379f3a79d0f9f89b71d46cfda6509e5446
power: supply: sysfs: parse string as enum when writing property

This fixes the TODO to parse strings and convert them to enum values
when writing to a power_supply class property sysfs attribute.

There is at least one driver that has a writable enum property that
previously could only be written as an integer, so a fallback to writing
enums as integers instead of strings is provided so we don't break existing
userspace programs.

Signed-off-by: David Lechner <david@lechnology.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
drivers/power/supply/power_supply_sysfs.c