From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-hwmon@vger.kernel.org
Cc: linux@roeck-us.net, samsagax@gmail.com,
linux-kernel@vger.kernel.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
"Rafael J. Wysocki" <rafael@kernel.org>
Subject: [PATCH 3/3] driver core: remove devm_device_add_groups()
Date: Tue, 4 Jul 2023 14:17:19 +0100 [thread overview]
Message-ID: <20230704131715.44454-8-gregkh@linuxfoundation.org> (raw)
In-Reply-To: <20230704131715.44454-5-gregkh@linuxfoundation.org>
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>
---
drivers/base/core.c | 45 ------------------------------------------
include/linux/device.h | 2 --
2 files changed, 47 deletions(-)
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 3dff5037943e..94187c0b577d 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -2748,15 +2748,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
@@ -2789,42 +2780,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 66c13965153d..6dd087e4223d 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -1164,8 +1164,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);
--
2.41.0
next prev parent reply other threads:[~2023-07-04 13:19 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-04 13:17 [PATCH 0/3] driver core: remove final user of devm_device_add_groups() Greg Kroah-Hartman
2023-07-04 13:17 ` [PATCH 1/3] hwmon: (oxp-sensors): remove static board variable Greg Kroah-Hartman
2023-07-04 13:39 ` Guenter Roeck
2023-07-04 13:44 ` Greg Kroah-Hartman
2023-07-04 14:14 ` Guenter Roeck
2023-07-04 16:14 ` Greg Kroah-Hartman
2023-07-04 16:43 ` Guenter Roeck
2023-07-04 16:52 ` Greg Kroah-Hartman
2023-07-04 19:44 ` Joaquin Aramendia
2023-07-04 13:17 ` [PATCH 2/3] hwmon: (oxp-sensors): move to use dev_groups from platform device Greg Kroah-Hartman
2023-07-04 13:17 ` Greg Kroah-Hartman [this message]
2023-07-04 16:05 ` [PATCH 3/3] driver core: remove devm_device_add_groups() Rafael J. Wysocki
2023-07-05 18:50 ` Dmitry Torokhov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230704131715.44454-8-gregkh@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=rafael@kernel.org \
--cc=samsagax@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.