Skip to content

Commit 7ad343e

Browse files
author
Desnes Nunes
committed
USB: serial: bus: fix const issue in usb_serial_device_match()
JIRA: https://issues.redhat.com/browse/RHEL-116016 Conflicts: * Avoiding commit d69d804 ("driver core: have match() callback in struct bus_type take a const *") that constifies device_driver *drv commit 92cd405 Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Date: Wed, 21 May 2025 15:41:34 +0200 usb_serial_device_match() takes a const pointer, and then decides to cast it away into a non-const one, which is not a good thing to do overall. Fix this up by properly setting the pointers to be const to preserve that attribute. Fixes: d69d804 ("driver core: have match() callback in struct bus_type take a const *") Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Desnes Nunes <desnesn@redhat.com>
1 parent 33663a1 commit 7ad343e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/usb/serial/bus.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ static int usb_serial_device_match(struct device *dev,
1717
struct device_driver *drv)
1818
{
1919
const struct usb_serial_port *port = to_usb_serial_port(dev);
20-
struct usb_serial_driver *driver = to_usb_serial_driver(drv);
20+
const struct usb_serial_driver *driver = to_usb_serial_driver(drv);
2121

2222
/*
2323
* drivers are already assigned to ports in serial_probe so it's

0 commit comments

Comments
 (0)