From: Greg Kroah-Hartman Date: Mon, 7 May 2012 21:46:48 +0000 (-0700) Subject: USB: serial: remove bizarre generic_serial probe function X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2edd284bd752e58ccb312f3d623267fb79857db3;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git USB: serial: remove bizarre generic_serial probe function I can't remember why I wrote it like this many many years ago, but it's not needed at all, let's rely on the usb-serial core for this function, especially as it is being overridden by it anyway. This lets us make usb_serial_probe() a static function, which it should be. Cc: Alan Stern Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c index a2dcf0871811..4e5e993771e9 100644 --- a/drivers/usb/serial/generic.c +++ b/drivers/usb/serial/generic.c @@ -28,9 +28,6 @@ static int debug; #ifdef CONFIG_USB_SERIAL_GENERIC -static int generic_probe(struct usb_interface *interface, - const struct usb_device_id *id); - static __u16 vendor = 0x05f9; static __u16 product = 0xffff; @@ -51,7 +48,6 @@ static const struct usb_device_id generic_serial_ids[] = { static struct usb_driver generic_driver = { .name = "usbserial_generic", - .probe = generic_probe, .id_table = generic_serial_ids, }; @@ -74,16 +70,6 @@ static struct usb_serial_driver * const serial_drivers[] = { &usb_serial_generic_device, NULL }; -static int generic_probe(struct usb_interface *interface, - const struct usb_device_id *id) -{ - const struct usb_device_id *id_pattern; - - id_pattern = usb_match_id(interface, generic_device_ids); - if (id_pattern != NULL) - return usb_serial_probe(interface, id); - return -ENODEV; -} #endif int usb_serial_generic_register(int _debug) diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index 9791312052e9..d1840aef0d53 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c @@ -699,7 +699,7 @@ static const struct tty_port_operations serial_port_ops = { .shutdown = serial_down, }; -int usb_serial_probe(struct usb_interface *interface, +static int usb_serial_probe(struct usb_interface *interface, const struct usb_device_id *id) { struct usb_device *dev = interface_to_usbdev(interface); diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h index 17e9746bbeb0..749836f2890c 100644 --- a/include/linux/usb/serial.h +++ b/include/linux/usb/serial.h @@ -298,9 +298,6 @@ extern void usb_serial_deregister_drivers(struct usb_driver *udriver, struct usb_serial_driver * const serial_drivers[]); extern void usb_serial_port_softint(struct usb_serial_port *port); -extern int usb_serial_probe(struct usb_interface *iface, - const struct usb_device_id *id); - extern int usb_serial_suspend(struct usb_interface *intf, pm_message_t message); extern int usb_serial_resume(struct usb_interface *intf);