lkml.org 
[lkml]   [2021]   [May]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] sysfs: Add helper BIN_ATTRIBUTE_GROUPS
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

\
 
 \ /
  Last update: 2021-05-19 19:05    [W:0.144 / U:0.416 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site