From: Heiner Kallweit <hkallweit1@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] sysfs: Add helper BIN_ATTRIBUTE_GROUPS
Date: Wed, 19 May 2021 21:02:47 +0200 [thread overview]
Message-ID: <1facebe2-1368-9b52-e0a1-f7a6eafc91ea@gmail.com> (raw)
In-Reply-To: <YKVFO4bmW/hkoUnx@kroah.com>
On 19.05.2021 19:04, Greg Kroah-Hartman wrote:
> On Wed, May 19, 2021 at 06:33:14PM +0200, Heiner Kallweit wrote:
>> New helper BIN_ATTRIBUTE_GROUPS() does the same as ATTRIBUTE_GROUPS(),
>> just for binary attributes.
>>
>> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
>> ---
>> include/linux/sysfs.h | 6 ++++++
>> 1 file changed, 6 insertions(+)
>>
>> diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
>> index d76a1ddf8..a12556a4b 100644
>> --- a/include/linux/sysfs.h
>> +++ b/include/linux/sysfs.h
>> @@ -162,6 +162,12 @@ static const struct attribute_group _name##_group = { \
>> }; \
>> __ATTRIBUTE_GROUPS(_name)
>>
>> +#define BIN_ATTRIBUTE_GROUPS(_name) \
>> +static const struct attribute_group _name##_group = { \
>> + .bin_attrs = _name##_attrs, \
>> +}; \
>> +__ATTRIBUTE_GROUPS(_name)
>
> Is this really needed by more than just 1 driver?
>
Few more use case I saw:
devcd_dev_groups in drivers/base/devcoredump.c
w1_f3a_group in drivers/w1/slaves/w1_ds2413.c
w1_slave_default_groups in drivers/w1/w1.c
> How about just "open code" this for now, binary sysfs files are rare.
>
> thanks,
>
> greg k-h
>
Heiner
next prev parent reply other threads:[~2021-05-19 19:03 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-19 16:32 [PATCH 0/2] eeprom: ee1004: Let device core handle attribute eeprom Heiner Kallweit
2021-05-19 16:33 ` [PATCH 1/2] sysfs: Add helper BIN_ATTRIBUTE_GROUPS Heiner Kallweit
2021-05-19 17:04 ` Greg Kroah-Hartman
2021-05-19 19:02 ` Heiner Kallweit [this message]
2021-05-21 18:41 ` Greg Kroah-Hartman
2021-05-21 18:41 ` Greg Kroah-Hartman
2021-05-21 18:45 ` Heiner Kallweit
2021-05-19 16:34 ` [PATCH 2/2] eeprom: ee1004: Let device core handle attribute eeprom Heiner Kallweit
2021-05-20 19:25 ` [PATCH v2] " Heiner Kallweit
2021-05-21 18:43 ` Heiner Kallweit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1facebe2-1368-9b52-e0a1-f7a6eafc91ea@gmail.com \
--to=hkallweit1@gmail.com \
--cc=arnd@arndb.de \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome