[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230313181843.1207845-6-gregkh@linuxfoundation.org>
Date: Mon, 13 Mar 2023 19:18:37 +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 06/12] driver core: class: make class_for_each_device() options const
class_for_each_device() does not modify the struct class or the struct
device passed into it, so mark them as const * to enforce that.
Cc: "Rafael J. Wysocki" <rafael@...nel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
drivers/base/class.c | 2 +-
include/linux/device/class.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/base/class.c b/drivers/base/class.c
index 5a60e8895165..4937d660c571 100644
--- a/drivers/base/class.c
+++ b/drivers/base/class.c
@@ -355,7 +355,7 @@ EXPORT_SYMBOL_GPL(class_dev_iter_exit);
* @fn is allowed to do anything including calling back into class
* code. There's no locking restriction.
*/
-int class_for_each_device(struct class *class, struct device *start,
+int class_for_each_device(const struct class *class, const struct device *start,
void *data, int (*fn)(struct device *, void *))
{
struct class_dev_iter iter;
diff --git a/include/linux/device/class.h b/include/linux/device/class.h
index 1f5cfae8db88..fdbcd487e508 100644
--- a/include/linux/device/class.h
+++ b/include/linux/device/class.h
@@ -109,7 +109,7 @@ extern void class_dev_iter_init(struct class_dev_iter *iter,
extern struct device *class_dev_iter_next(struct class_dev_iter *iter);
extern void class_dev_iter_exit(struct class_dev_iter *iter);
-extern int class_for_each_device(struct class *class, struct device *start,
+extern int class_for_each_device(const struct class *class, const struct device *start,
void *data,
int (*fn)(struct device *dev, void *data));
extern struct device *class_find_device(struct class *class,
--
2.39.2
Powered by blists - more mailing lists