[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230313181843.1207845-9-gregkh@linuxfoundation.org>
Date: Mon, 13 Mar 2023 19:18:40 +0100
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: rafael@...nel.org, Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: [PATCH 09/12] driver core: device: make device_destroy() take a const class *
device_destroy() does not modify the struct class passed into it, so
mark it as const to enforce this rule.
Cc: "Rafael J. Wysocki" <rafael@...nel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
drivers/base/core.c | 2 +-
include/linux/device.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 57076837b33e..f3b7040ef9b6 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -4383,7 +4383,7 @@ EXPORT_SYMBOL_GPL(device_create_with_groups);
* This call unregisters and cleans up a device that was created with a
* call to device_create().
*/
-void device_destroy(struct class *class, dev_t devt)
+void device_destroy(const struct class *class, dev_t devt)
{
struct device *dev;
diff --git a/include/linux/device.h b/include/linux/device.h
index 0f128520f6e5..c0c02a00fe87 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -1019,7 +1019,7 @@ __printf(6, 7) struct device *
device_create_with_groups(struct class *cls, struct device *parent, dev_t devt,
void *drvdata, const struct attribute_group **groups,
const char *fmt, ...);
-void device_destroy(struct class *cls, dev_t devt);
+void device_destroy(const struct class *cls, dev_t devt);
int __must_check device_add_groups(struct device *dev,
const struct attribute_group **groups);
--
2.39.2
Powered by blists - more mailing lists