lkml.org 
[lkml]   [2010]   [Nov]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] HID: roccat: using new sysfs_create_bin_group() in kone driver
On Fri, Nov 12, 2010 at 04:52:32PM -0800, Greg KH wrote:
> On Fri, Nov 12, 2010 at 04:21:45PM -0800, Eric Biederman wrote:
> > On Fri, Nov 12, 2010 at 10:18 AM, Stefan Achatz <stefan_achatz@web.de> wrote:
> > > hid-roccat-kone now uses new group functions for creating binary
> > > sysfs attributes.
> >
> > Looking at this, I have a problem with the way this works.
> > You are still doing this the hard and racy way.
> >
> > sysfs attributes that are only added when we initialize the hardware and
> > are only removed when we remove the driver should use the device layer
> > functions to create their attributes.
> >
> > This achieves two things. The code is easier to write because there
> > is less of it.
> > The notification to user space happens after the attributes appear so
> > that you don't
> > have strange hotplug races.
> >
> > If there a chance you can look at implementing this in the simpler
> > race free way?
>
> Good point, just attach this attribute group to the device and the
> driver core will automatically create the files for you.
>

Attribute group in device structure is normally owned and managed by
subsystem core; without additional plumbing drivers should not be
touching it, at least not normally.

Plus we do not have binary attribute group in device structure [yet].

--
Dmitry


\
 
 \ /
  Last update: 2010-11-13 07:09    [W:0.031 / U:0.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site