USB: make devnode() callback in usb_class_driver take a const *
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 1 Oct 2022 16:51:28 +0000 (18:51 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 20 Oct 2022 10:11:56 +0000 (12:11 +0200)
With the changes to the driver core to make more pointers const, the USB
subsystem also needs to be modified to take a const * for the devnode
callback so that the driver core's constant pointer will also be
properly propagated.

Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Cc: Juergen Stuber <starblue@users.sourceforge.net>
Reviewed-by: Johan Hovold <johan@kernel.org>
Acked-by: Pete Zaitcev <zaitcev@redhat.com>
Reviewed-by: Jiri Kosina <jkosina@suse.cz>
Link: https://lore.kernel.org/r/20221001165128.2688526-1-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hid/usbhid/hiddev.c
drivers/usb/class/usblp.c
drivers/usb/misc/iowarrior.c
drivers/usb/misc/legousbtower.c
include/linux/usb.h

index 2fb2991..59cf3dd 100644 (file)
@@ -857,7 +857,7 @@ static const struct file_operations hiddev_fops = {
        .llseek         = noop_llseek,
 };
 
-static char *hiddev_devnode(struct device *dev, umode_t *mode)
+static char *hiddev_devnode(const struct device *dev, umode_t *mode)
 {
        return kasprintf(GFP_KERNEL, "usb/%s", dev_name(dev));
 }
index f27b4ae..5a2e433 100644 (file)
@@ -1090,7 +1090,7 @@ static const struct file_operations usblp_fops = {
        .llseek =       noop_llseek,
 };
 
-static char *usblp_devnode(struct device *dev, umode_t *mode)
+static char *usblp_devnode(const struct device *dev, umode_t *mode)
 {
        return kasprintf(GFP_KERNEL, "usb/%s", dev_name(dev));
 }
index 988a8c0..f9427a6 100644 (file)
@@ -717,7 +717,7 @@ static const struct file_operations iowarrior_fops = {
        .llseek = noop_llseek,
 };
 
-static char *iowarrior_devnode(struct device *dev, umode_t *mode)
+static char *iowarrior_devnode(const struct device *dev, umode_t *mode)
 {
        return kasprintf(GFP_KERNEL, "usb/%s", dev_name(dev));
 }
index 1c9e091..379cf01 100644 (file)
@@ -245,7 +245,7 @@ static const struct file_operations tower_fops = {
        .llseek =       tower_llseek,
 };
 
-static char *legousbtower_devnode(struct device *dev, umode_t *mode)
+static char *legousbtower_devnode(const struct device *dev, umode_t *mode)
 {
        return kasprintf(GFP_KERNEL, "usb/%s", dev_name(dev));
 }
index 3a55131..4b463a5 100644 (file)
@@ -1321,7 +1321,7 @@ struct usb_device_driver {
  */
 struct usb_class_driver {
        char *name;
-       char *(*devnode)(struct device *dev, umode_t *mode);
+       char *(*devnode)(const struct device *dev, umode_t *mode);
        const struct file_operations *fops;
        int minor_base;
 };