Re: [PATCH] power: supply: sysfs: parse string as enum when writing property

From: Sebastian Reichel
Date: Wed Apr 12 2017 - 10:41:50 EST


Hi,

On Tue, Apr 11, 2017 at 11:38:40AM -0500, David Lechner wrote:
> On 04/11/2017 11:12 AM, Sebastian Reichel wrote:
> > On Mon, Apr 03, 2017 at 02:52:57PM -0500, David Lechner wrote:
> > > 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@xxxxxxxxxxxxxx>
> > >
> > > ---
> > > drivers/power/supply/power_supply_sysfs.c | 124 ++++++++++++++++++++----------
> > > 1 file changed, 85 insertions(+), 39 deletions(-)
> >
> > drivers/power/supply/power_supply_sysfs.c: In function âpower_supply_store_propertyâ:
> > drivers/power/supply/power_supply_sysfs.c:138:9: error: implicit declaration of function âsysfs_match_stringâ [-Werror=implicit-function-declaration]
>
> This is something I found in linux-next. I did not realize it was new.
> It looks like it is part of a patch series for USB-C connectors.[1]
>
> It greatly simplifies things, so I think we should wait for that patch to
> land.

Agreed. Can you resend after v4.12-rc1 has been tagged?

-- Sebastian

Attachment: signature.asc
Description: PGP signature