Re: [RFC PATCH 1/5] driver core: Introduce device_create_groups

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Jul 06, 2013 at 10:24:51AM -0700, Guenter Roeck wrote:
> device_create_groups lets callers create devices as well as associated
> sysfs attributes with a single call. This avoids race conditions seen
> if sysfs attributes on new devices are created later.
> 
> Signed-off-by: Guenter Roeck <linux@xxxxxxxxxxxx>
> ---
>  drivers/base/core.c    |   60 +++++++++++++++++++++++++++++++++++++++++++++---
>  include/linux/device.h |    4 ++++
>  2 files changed, 61 insertions(+), 3 deletions(-)

Ok, in reading the code, it makes more sense to me now.  That looks
good, but the name is a bit rough.  How many device_create() calls do we
have in the kernel today?

$ git grep -w device_create | wc -l
127

That's really not that many, I wonder how many of those should be using
something like this as well?  A quick look showed that the sound core
should be using this, but maybe not all that many others...

My objection to the name is at first glance, it sounds like you are
creating "groups", not a device + groups.
"device_create_with_groups()"?

Ick, naming is hard...

greg k-h

_______________________________________________
lm-sensors mailing list
lm-sensors@xxxxxxxxxxxxxx
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors




[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux