From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Heiner Kallweit <hkallweit1@gmail.com>
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 19:04:59 +0200 [thread overview]
Message-ID: <YKVFO4bmW/hkoUnx@kroah.com> (raw)
In-Reply-To: <e20db248-ed30-cf5d-a37c-b538dceaa5b2@gmail.com>
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?
How about just "open code" this for now, binary sysfs files are rare.
thanks,
greg k-h
next prev parent reply other threads:[~2021-05-19 17:05 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 [this message]
2021-05-19 19:02 ` Heiner Kallweit
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=YKVFO4bmW/hkoUnx@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=arnd@arndb.de \
--cc=hkallweit1@gmail.com \
--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