lkml.org 
[lkml]   [2015]   [Jan]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 0/2] Add device_create_files() and device_remove_files() helpers
On Wed, Jan 28, 2015 at 09:46:12PM +0100, Takashi Iwai wrote:
> Hi,
>
> this is a simple patch to add device_create_files() and
> device_remove_files() to replace multiple device_create_file() or
> _remove() calls with a single shot with the device_attr list.
>
> It's basically just a clean up, but also helps to simplify the error
> handling a lot in many existing codes since the function itself does
> rollback at error.
>
> The series contains a patch to apply these to drivers/base/node.c.
> I have lots of patches (up to 30) to use these in the whole tree, but
> maybe it'd be easier too apply once after this stuff is merged at
> first. It's just a cleanup so no urgent task, after all.

I'd like to some day be able to drop device_create_file entirely, as it
is almost always used in a racy way (but not always, so we can't get rid
of it today.)

A driver should be using an attribute group and be created/registered
with it if they want any files associated with it, so giving people the
ability to add large numbers of files all at once seems like the wrong
thing to do :)

thanks,

greg k-h


\
 
 \ /
  Last update: 2015-01-29 03:41    [W:0.178 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site