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


Groups > linux.kernel > #1662825 > unrolled thread

Re: [PATCH 15/16] tty: serdev: use dev_groups and not dev_attrs for bus_type

Started byStephen Rothwell <sfr@canb.auug.org.au>
First post2017-06-10 02:00 +0200
Last post2017-06-10 14:00 +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 15/16] tty: serdev: use dev_groups and not dev_attrs for  bus_type Stephen Rothwell <sfr@canb.auug.org.au> - 2017-06-10 02:00 +0200
    Re: [PATCH 15/16] tty: serdev: use dev_groups and not dev_attrs for  bus_type Stephen Rothwell <sfr@canb.auug.org.au> - 2017-06-10 02:10 +0200
      Re: [PATCH 15/16] tty: serdev: use dev_groups and not dev_attrs for  bus_type Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-06-10 14:00 +0200

#1662825 — Re: [PATCH 15/16] tty: serdev: use dev_groups and not dev_attrs for bus_type

FromStephen Rothwell <sfr@canb.auug.org.au>
Date2017-06-10 02:00 +0200
SubjectRe: [PATCH 15/16] tty: serdev: use dev_groups and not dev_attrs for bus_type
Message-ID<tQBYS-7YR-7@gated-at.bofh.it>
Hi Greg,

On Tue,  6 Jun 2017 21:22:20 +0200 Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
>
> -static struct device_attribute serdev_device_attrs[] = {
> -	__ATTR_RO(modalias),
> -	__ATTR_NULL
> +static struct attribute *serdev_device_attrs[] = {
                            ^^^^^^^^^^^^^^^^^^^
Should have been "serdev_device_groups"

> +	&dev_attr_modalias.attr,
> +	NULL,
>  };
> +ATTRIBUTE_GROUPS(serdev_device);
>  
>  static struct bus_type serdev_bus_type = {
>  	.name		= "serial",
> @@ -262,7 +264,7 @@ static struct bus_type serdev_bus_type = {
>  	.probe		= serdev_drv_probe,
>  	.remove		= serdev_drv_remove,
>  	.uevent		= serdev_uevent,
> -	.dev_attrs	= serdev_device_attrs,
> +	.dev_groups	= serdev_device_groups,
>  };
-- 
Cheers,
Stephen Rothwell

[toc] | [next] | [standalone]


#1662827

FromStephen Rothwell <sfr@canb.auug.org.au>
Date2017-06-10 02:10 +0200
Message-ID<tQC8y-8iq-11@gated-at.bofh.it>
In reply to#1662825
Hi Greg,

On Sat, 10 Jun 2017 09:56:49 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> > +static struct attribute *serdev_device_attrs[] = {  
>                             ^^^^^^^^^^^^^^^^^^^
> Should have been "serdev_device_groups"

Sorry, my mistake.

> > +	&dev_attr_modalias.attr,
> > +	NULL,
> >  };
> > +ATTRIBUTE_GROUPS(serdev_device);

I really hate macros that create symbols by concatenating parts. :-(

-- 
Cheers,
Stephen Rothwell

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


#1662944

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-06-10 14:00 +0200
Message-ID<tQNdD-6xF-11@gated-at.bofh.it>
In reply to#1662827
On Sat, Jun 10, 2017 at 10:01:22AM +1000, Stephen Rothwell wrote:
> Hi Greg,
> 
> On Sat, 10 Jun 2017 09:56:49 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> >
> > > +static struct attribute *serdev_device_attrs[] = {  
> >                             ^^^^^^^^^^^^^^^^^^^
> > Should have been "serdev_device_groups"
> 
> Sorry, my mistake.
> 
> > > +	&dev_attr_modalias.attr,
> > > +	NULL,
> > >  };
> > > +ATTRIBUTE_GROUPS(serdev_device);
> 
> I really hate macros that create symbols by concatenating parts. :-(

I totally agree, but it's the only way I could come up with at the time
to make this type of macro to simplify a lot of boiler-plate code.

sorry,

greg k-h

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web