From e17c1aa2e165556018169ed4dfcc5713167bdb35 Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Wed, 26 Jun 2013 16:47:34 +0200 Subject: [PATCH] USB: ftdi_sio: remove vendor/product module parameters Remove the vendor and product module parameters which were added a long time ago when we did not have the dynamic sysfs interface to add new device ids (and which isn't limited to a single new vid/pid pair). A vid/pid pair can be added dynamically using sysfs, for example: echo 0403 1234 >/sys/bus/usb-serial/drivers/ftdi_sio/new_id Also fix up the in-code comment that got the sysfs path wrong. Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/ftdi_sio.c | 36 +++-------------------------------- 1 file changed, 3 insertions(+), 33 deletions(-) diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index 86f6dfe87f86..9bd1f6f1ea80 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c @@ -51,8 +51,6 @@ #define DRIVER_AUTHOR "Greg Kroah-Hartman , Bill Ryder , Kuba Ober , Andreas Mohr, Johan Hovold " #define DRIVER_DESC "USB FTDI Serial Converters Driver" -static __u16 vendor = FTDI_VID; -static __u16 product; struct ftdi_private { enum ftdi_chip_type chip_type; @@ -144,8 +142,8 @@ static struct ftdi_sio_quirk ftdi_8u2232c_quirk = { /* - * Device ID not listed? Test via module params product/vendor or - * /sys/bus/usb/ftdi_sio/new_id, then send patch/report! + * Device ID not listed? Test it using + * /sys/bus/usb-serial/drivers/ftdi_sio/new_id and send a patch or report. */ static struct usb_device_id id_table_combined [] = { { USB_DEVICE(FTDI_VID, FTDI_ZEITCONTROL_TAGTRACE_MIFARE_PID) }, @@ -881,7 +879,6 @@ static struct usb_device_id id_table_combined [] = { { USB_DEVICE(FTDI_VID, FTDI_LUMEL_PD12_PID) }, /* Crucible Devices */ { USB_DEVICE(FTDI_VID, FTDI_CT_COMET_PID) }, - { }, /* Optional parameter entry */ { } /* Terminating entry */ }; @@ -2377,38 +2374,11 @@ static int ftdi_ioctl(struct tty_struct *tty, return -ENOIOCTLCMD; } -static int __init ftdi_init(void) -{ - if (vendor > 0 && product > 0) { - /* Add user specified VID/PID to reserved element of table. */ - int i; - for (i = 0; id_table_combined[i].idVendor; i++) - ; - id_table_combined[i].match_flags = USB_DEVICE_ID_MATCH_DEVICE; - id_table_combined[i].idVendor = vendor; - id_table_combined[i].idProduct = product; - } - return usb_serial_register_drivers(serial_drivers, KBUILD_MODNAME, id_table_combined); -} - -static void __exit ftdi_exit(void) -{ - usb_serial_deregister_drivers(serial_drivers); -} - - -module_init(ftdi_init); -module_exit(ftdi_exit); +module_usb_serial_driver(serial_drivers, id_table_combined); MODULE_AUTHOR(DRIVER_AUTHOR); MODULE_DESCRIPTION(DRIVER_DESC); MODULE_LICENSE("GPL"); -module_param(vendor, ushort, 0); -MODULE_PARM_DESC(vendor, "User specified vendor ID (default=" - __MODULE_STRING(FTDI_VID)")"); -module_param(product, ushort, 0); -MODULE_PARM_DESC(product, "User specified product ID"); - module_param(ndi_latency_timer, int, S_IRUGO | S_IWUSR); MODULE_PARM_DESC(ndi_latency_timer, "NDI device latency timer override"); -- 2.20.1