summaryrefslogtreecommitdiff
path: root/drivers/base/class.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-03-13 21:18:37 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-03-17 17:16:37 +0300
commit69df024ebbf8b1d4d8f0808b5700688fed9e45e9 (patch)
treee6027639383b5ff0f7f0e7ee4264997523634106 /drivers/base/class.c
parenta2fd6e42e4fb661e183977072022b7dd8dd65d90 (diff)
downloadlinux-69df024ebbf8b1d4d8f0808b5700688fed9e45e9.tar.xz
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@kernel.org> Link: https://lore.kernel.org/r/20230313181843.1207845-6-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 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;