@@ -2845,15 +2845,6 @@ static void devm_attr_group_remove(struct device *dev, void *res)
28452845 sysfs_remove_group (& dev -> kobj , group );
28462846}
28472847
2848- static void devm_attr_groups_remove (struct device * dev , void * res )
2849- {
2850- union device_attr_group_devres * devres = res ;
2851- const struct attribute_group * * groups = devres -> groups ;
2852-
2853- dev_dbg (dev , "%s: removing groups %p\n" , __func__ , groups );
2854- sysfs_remove_groups (& dev -> kobj , groups );
2855- }
2856-
28572848/**
28582849 * devm_device_add_group - given a device, create a managed attribute group
28592850 * @dev: The device to create the group for
@@ -2886,42 +2877,6 @@ int devm_device_add_group(struct device *dev, const struct attribute_group *grp)
28862877}
28872878EXPORT_SYMBOL_GPL (devm_device_add_group );
28882879
2889- /**
2890- * devm_device_add_groups - create a bunch of managed attribute groups
2891- * @dev: The device to create the group for
2892- * @groups: The attribute groups to create, NULL terminated
2893- *
2894- * This function creates a bunch of managed attribute groups. If an error
2895- * occurs when creating a group, all previously created groups will be
2896- * removed, unwinding everything back to the original state when this
2897- * function was called. It will explicitly warn and error if any of the
2898- * attribute files being created already exist.
2899- *
2900- * Returns 0 on success or error code from sysfs_create_group on failure.
2901- */
2902- int devm_device_add_groups (struct device * dev ,
2903- const struct attribute_group * * groups )
2904- {
2905- union device_attr_group_devres * devres ;
2906- int error ;
2907-
2908- devres = devres_alloc (devm_attr_groups_remove ,
2909- sizeof (* devres ), GFP_KERNEL );
2910- if (!devres )
2911- return - ENOMEM ;
2912-
2913- error = sysfs_create_groups (& dev -> kobj , groups );
2914- if (error ) {
2915- devres_free (devres );
2916- return error ;
2917- }
2918-
2919- devres -> groups = groups ;
2920- devres_add (dev , devres );
2921- return 0 ;
2922- }
2923- EXPORT_SYMBOL_GPL (devm_device_add_groups );
2924-
29252880static int device_add_attrs (struct device * dev )
29262881{
29272882 const struct class * class = dev -> class ;
0 commit comments