aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-07-29 16:07:16 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-03-27 09:13:26 +0100
commitff861d67de36fed6440f540029c2ffe4e9af6e51 (patch)
treef7d9a6be2ac58d9e601a99d95a8dc56aa32fe90f
parent1256407f8341438e1f7efd4ff65f1989f86ee5a9 (diff)
downloaddriver-core-debugfs_cleanup.tar.gz
driver core: remove devm_device_add_groups()debugfs_cleanup
There is no more in-kernel users of this function, and no driver should ever be using it, so remove it from the kernel. Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com> Cc: "Rafael J. Wysocki" <rafael@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/base/core.c45
-rw-r--r--include/linux/device.h2
2 files changed, 0 insertions, 47 deletions
diff --git a/drivers/base/core.c b/drivers/base/core.c
index b93f3c5716aee..e29742d1b86d0 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -2829,15 +2829,6 @@ static void devm_attr_group_remove(struct device *dev, void *res)
sysfs_remove_group(&dev->kobj, group);
}
-static void devm_attr_groups_remove(struct device *dev, void *res)
-{
- union device_attr_group_devres *devres = res;
- const struct attribute_group **groups = devres->groups;
-
- dev_dbg(dev, "%s: removing groups %p\n", __func__, groups);
- sysfs_remove_groups(&dev->kobj, groups);
-}
-
/**
* devm_device_add_group - given a device, create a managed attribute group
* @dev: The device to create the group for
@@ -2870,42 +2861,6 @@ int devm_device_add_group(struct device *dev, const struct attribute_group *grp)
}
EXPORT_SYMBOL_GPL(devm_device_add_group);
-/**
- * devm_device_add_groups - create a bunch of managed attribute groups
- * @dev: The device to create the group for
- * @groups: The attribute groups to create, NULL terminated
- *
- * This function creates a bunch of managed attribute groups. If an error
- * occurs when creating a group, all previously created groups will be
- * removed, unwinding everything back to the original state when this
- * function was called. It will explicitly warn and error if any of the
- * attribute files being created already exist.
- *
- * Returns 0 on success or error code from sysfs_create_group on failure.
- */
-int devm_device_add_groups(struct device *dev,
- const struct attribute_group **groups)
-{
- union device_attr_group_devres *devres;
- int error;
-
- devres = devres_alloc(devm_attr_groups_remove,
- sizeof(*devres), GFP_KERNEL);
- if (!devres)
- return -ENOMEM;
-
- error = sysfs_create_groups(&dev->kobj, groups);
- if (error) {
- devres_free(devres);
- return error;
- }
-
- devres->groups = groups;
- devres_add(dev, devres);
- return 0;
-}
-EXPORT_SYMBOL_GPL(devm_device_add_groups);
-
static int device_add_attrs(struct device *dev)
{
const struct class *class = dev->class;
diff --git a/include/linux/device.h b/include/linux/device.h
index 97c4b046c09d9..1ed92008d13ec 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -1201,8 +1201,6 @@ static inline void device_remove_group(struct device *dev,
return device_remove_groups(dev, groups);
}
-int __must_check devm_device_add_groups(struct device *dev,
- const struct attribute_group **groups);
int __must_check devm_device_add_group(struct device *dev,
const struct attribute_group *grp);