dev_groups added to struct driver Persistent tag for others to pull this branch from This is the first patch in a longer series that adds the ability for the driver core to create and remove a list of attribute groups automatically when the device is bound/unbound from a specific driver. See: https://lore.kernel.org/r/20190731124349.4474-2-gregkh@linuxfoundation.org for details on this patch, and examples of how to use it in other drivers.
Showing the changes to include/linux (1 of 2 files). Show all
Unified · Split
| @@ -262,6 +262,8 @@ enum probe_type { · 261 unmodified lines | ||
| 262 | 262 | * @resume: Called to bring a device from sleep mode. |
| 263 | 263 | * @groups: Default attributes that get created by the driver core |
| 264 | 264 | * automatically. |
| 265 | + * @dev_groups: Additional attributes attached to device instance once the | |
| 266 | + * it is bound to the driver. | |
| 265 | 267 | * @pm: Power management operations of the device which matched |
| 266 | 268 | * this driver. |
| 267 | 269 | * @coredump: Called when sysfs entry is written to. The device driver |
| @@ -296,6 +298,7 @@ struct device_driver { · 28 unmodified lines | ||
| 296 | 298 | int (*suspend) (struct device *dev, pm_message_t state); |
| 297 | 299 | int (*resume) (struct device *dev); |
| 298 | 300 | const struct attribute_group **groups; |
| 301 | + const struct attribute_group **dev_groups; | |
| 299 | 302 | |
| 300 | 303 | const struct dev_pm_ops *pm; |
| 301 | 304 | void (*coredump) (struct device *dev); |