Commit 5033ac5c authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

USB: make devnode() callback in usb_class_driver take a const *

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: default avatarJohan Hovold <johan@kernel.org>
Acked-by: default avatarPete Zaitcev <zaitcev@redhat.com>
Reviewed-by: default avatarJiri Kosina <jkosina@suse.cz>
Link: https://lore.kernel.org/r/20221001165128.2688526-1-gregkh@linuxfoundation.orgSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 593efa40
......@@ -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));
}
......
......@@ -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));
}
......
......@@ -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));
}
......
......@@ -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));
}
......
......@@ -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;
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment