[PATCH 2/2] soundwire: sysfs: add slave status and device number before probe

Greg KH gregkh at linuxfoundation.org
Thu Sep 17 15:06:40 CEST 2020


On Thu, Sep 17, 2020 at 07:54:50AM -0500, Pierre-Louis Bossart wrote:
> Thanks for the review Greg,
> 
> > > +int sdw_slave_status_sysfs_init(struct sdw_slave *slave)
> > > +{
> > > +	return device_add_group(&slave->dev, &sdw_slave_status_attr_group);
> > 
> > DOesn't this race with userspace?  Why not make this part of the default
> > set of device attributes and have the driver core create them
> > automatically?
> 
> What did you mean by 'default set of device attributes', would you mind
> providing a pointer to an example so that I can look into this?

Set the "groups" pointer in any one of the normal driver core structures
(struct device_type, struct device, struct device_driver), or the
"bus_groups", "dev_groups", or "drv_groups" pointer in struct bus_type.

that should give you something to go on :)

thanks,

greg k-h


More information about the Alsa-devel mailing list