Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1621452 > unrolled thread

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

Started bySebastian Reichel <sre@kernel.org>
First post2017-04-11 18:20 +0200
Last post2017-04-12 16:50 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] power: supply: sysfs: parse string as enum when writing  property Sebastian Reichel <sre@kernel.org> - 2017-04-11 18:20 +0200
    Re: [PATCH] power: supply: sysfs: parse string as enum when writing  property David Lechner <david@lechnology.com> - 2017-04-11 18:40 +0200
      Re: [PATCH] power: supply: sysfs: parse string as enum when writing  property Sebastian Reichel <sre@kernel.org> - 2017-04-12 16:50 +0200

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

FromSebastian Reichel <sre@kernel.org>
Date2017-04-11 18:20 +0200
SubjectRe: [PATCH] power: supply: sysfs: parse string as enum when writing property
Message-ID<tv6Gn-QX-31@gated-at.bofh.it>

[Multipart message — attachments visible in raw view] — view raw

Hi,

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@lechnology.com>
>
> ---
>  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]

-- Sebastian

[toc] | [next] | [standalone]


#1621465

FromDavid Lechner <david@lechnology.com>
Date2017-04-11 18:40 +0200
Message-ID<tv6ZJ-Y3-35@gated-at.bofh.it>
In reply to#1621452
On 04/11/2017 11:12 AM, Sebastian Reichel wrote:
> Hi,
>
> 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@lechnology.com>
>>
>> ---
>>  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.


[1]: https://patchwork.kernel.org/patch/9636485/

[toc] | [prev] | [next] | [standalone]


#1622206

FromSebastian Reichel <sre@kernel.org>
Date2017-04-12 16:50 +0200
Message-ID<tvrKO-5EQ-15@gated-at.bofh.it>
In reply to#1621465

[Multipart message — attachments visible in raw view] — view raw

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@lechnology.com>
> > > 
> > > ---
> > >  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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web