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: 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>
This commit is contained in:
Родитель
593efa4091
Коммит
5033ac5c58
|
@ -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;
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче