summaryrefslogtreecommitdiffstats
path: root/drivers/base/class.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-03-13 19:18:38 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-03-17 15:16:39 +0100
commitcf41015ea8d3f2ae451d9b7e39ef42569caeb875 (patch)
treebc38701346e5e6c1582a805e20bcfee240a7527b /drivers/base/class.c
parentdriver core: class: make class_for_each_device() options const (diff)
downloadlinux-cf41015ea8d3f2ae451d9b7e39ef42569caeb875.tar.xz
linux-cf41015ea8d3f2ae451d9b7e39ef42569caeb875.zip
driver core: class: make class_find_device*() options const
The class_find_device*() functions do 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@kernel.org> Link: https://lore.kernel.org/r/20230313181843.1207845-7-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base/class.c')
-rw-r--r--drivers/base/class.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/base/class.c b/drivers/base/class.c
index 4937d660c571..52ba0187e66d 100644
--- a/drivers/base/class.c
+++ b/drivers/base/class.c
@@ -402,7 +402,7 @@ EXPORT_SYMBOL_GPL(class_for_each_device);
* @match is allowed to do anything including calling back into class
* code. There's no locking restriction.
*/
-struct device *class_find_device(struct class *class, struct device *start,
+struct device *class_find_device(const struct class *class, const struct device *start,
const void *data,
int (*match)(struct device *, const void *))
{