summaryrefslogtreecommitdiff
path: root/include/linux/device.h
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-03-13 21:18:43 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-03-17 17:16:50 +0300
commit2bd5c63978b771462da10d8771f56a1e656501d9 (patch)
treebd1ad401d7903c859990feb6ed7f08bb02c897f2 /include/linux/device.h
parent9fa120fbd507e58af3494b8765427fdc8181e1eb (diff)
downloadlinux-2bd5c63978b771462da10d8771f56a1e656501d9.tar.xz
driver core: device: make device_create*() take a const struct class *
The functions device_create() and device_create_with_groups() do not modify the struct class passed into it, so enforce this by changing the function parameters to be struct const class. Cc: "Rafael J. Wysocki" <rafael@kernel.org> Link: https://lore.kernel.org/r/20230313181843.1207845-12-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/device.h')
-rw-r--r--include/linux/device.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/device.h b/include/linux/device.h
index ea07b95b06e5..862397ae520d 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -1015,10 +1015,10 @@ bool device_is_bound(struct device *dev);
* Easy functions for dynamically creating devices on the fly
*/
__printf(5, 6) struct device *
-device_create(struct class *cls, struct device *parent, dev_t devt,
+device_create(const struct class *cls, struct device *parent, dev_t devt,
void *drvdata, const char *fmt, ...);
__printf(6, 7) struct device *
-device_create_with_groups(struct class *cls, struct device *parent, dev_t devt,
+device_create_with_groups(const struct class *cls, struct device *parent, dev_t devt,
void *drvdata, const struct attribute_group **groups,
const char *fmt, ...);
void device_destroy(const struct class *cls, dev_t devt);