Skip to content

RFC Introduce and use device_create_groups

Guenter Roeck lkml lm-sensors 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest5 patches 12 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5driver core: Introduce device_create_groupsdrivers/base/core.c include/linux/device.h+61 -32 replies
2/5hwmon: Introduce hwmon_device_register_groupsdrivers/hwmon/hwmon.c include/linux/hwmon.h+15 -30 replies
3/5hwmon: (ds1621) Convert to use hwmon_device_register_groupsdrivers/hwmon/ds1621.c+9 -169 replies
4/5hwmon: (gpio-fan) Convert to use hwmon_device_register_groupsdrivers/hwmon/gpio-fan.c+9 -140 replies
5/5hwmon: (ltc4245) Convert to use hwmon_device_register_groupsdrivers/hwmon/ltc4245.c+13 -450 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/5] Introduce and use device_create_groups

This patch series introduces the new driver core API function device_create_groups().

device_create_groups() lets callers create devices as well as associated sysfs attributes with a single call. This avoids potential race conditions seen if sysfs attributes on new devices are created later.

The rationale for the new API is that sysfs attributes should be created synchronously with device creation to avoid race conditions, as outlined in
http://www.linuxfoundation.org/news-media/blogs/browse/2013/06/how-create-sysfs-file-correctly.

Unfortunately, the only API function to create a device dynamically is device_create, which does not support the notion of adding sysfs attributes when creating a device. The new API call is similar but lets the caller provide a list of sysfs attribute groups.

The first patch in the series introduces the new driver core API function.

The second patch introduces hwmon_device_register_groups(), which uses the new API call.

The remaining patches convert some hwmon drivers to use the new API to show and test its use.

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors