From ba9dc657af86d05d2971633e57d1f6f94ed60472 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 16 Nov 2005 13:41:28 -0800 Subject: [PATCH] USB: allow usb drivers to disable dynamic ids This lets drivers, like the usb-serial ones, disable the ability to add ids from sysfs. The usb-serial drivers are "odd" in that they are really usb-serial bus drivers, not usb bus drivers, so the dynamic id logic will have to go into the usb-serial bus core for those drivers to get that ability. Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/io_edgeport.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/usb/serial/io_edgeport.c') diff --git a/drivers/usb/serial/io_edgeport.c b/drivers/usb/serial/io_edgeport.c index dc4c498..276bd42 100644 --- a/drivers/usb/serial/io_edgeport.c +++ b/drivers/usb/serial/io_edgeport.c @@ -247,6 +247,7 @@ static struct usb_driver io_driver = { .probe = usb_serial_probe, .disconnect = usb_serial_disconnect, .id_table = id_table_combined, + .no_dynamic_id = 1, }; /* function prototypes for all of our local functions */ -- cgit v1.1 From 75318d2d7cab77b14c5d3dbd5e69f2680a769e16 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 21 Nov 2005 14:53:03 -0800 Subject: [PATCH] USB: remove .owner field from struct usb_driver It is no longer needed, so let's remove it, saving a bit of memory. Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/io_edgeport.c | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers/usb/serial/io_edgeport.c') diff --git a/drivers/usb/serial/io_edgeport.c b/drivers/usb/serial/io_edgeport.c index 276bd42..4e2b599 100644 --- a/drivers/usb/serial/io_edgeport.c +++ b/drivers/usb/serial/io_edgeport.c @@ -242,7 +242,6 @@ static void edge_shutdown (struct usb_serial *serial); #include "io_tables.h" /* all of the devices that this driver supports */ static struct usb_driver io_driver = { - .owner = THIS_MODULE, .name = "io_edgeport", .probe = usb_serial_probe, .disconnect = usb_serial_disconnect, -- cgit v1.1 From 4c4c9432a6c916729c7296c47fe93b053a73e20c Mon Sep 17 00:00:00 2001 From: Arjan van de Ven Date: Tue, 29 Nov 2005 09:43:42 +0100 Subject: [PATCH] USB: mark various usb tables const patch below marks various USB tables and variables as const so that they end up in .rodata section and don't cacheline share with things that get written to. For the non-array variables it also allows gcc to optimize more. Signed-off-by: Arjan van de Ven Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/io_edgeport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/usb/serial/io_edgeport.c') diff --git a/drivers/usb/serial/io_edgeport.c b/drivers/usb/serial/io_edgeport.c index 4e2b599..89bb356 100644 --- a/drivers/usb/serial/io_edgeport.c +++ b/drivers/usb/serial/io_edgeport.c @@ -184,7 +184,7 @@ struct divisor_table_entry { // These assume a 3.6864MHz crystal, the standard /16, and // MCR.7 = 0. // -static struct divisor_table_entry divisor_table[] = { +static const struct divisor_table_entry divisor_table[] = { { 50, 4608}, { 75, 3072}, { 110, 2095}, /* 2094.545455 => 230450 => .0217 % over */ -- cgit v1.1 From 52950ed40dc97456209979af1d8f51b63cf6dcab Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Sun, 11 Dec 2005 16:20:08 +0100 Subject: [PATCH] USB: Use ARRAY_SIZE macro Use ARRAY_SIZE macro instead of sizeof(x)/sizeof(x[0]) and remove duplicates of ARRAY_SIZE. Some trailing whitespaces are also removed. Patch is compile-tested on i386. Signed-off-by: Tobias Klauser Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/io_edgeport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/usb/serial/io_edgeport.c') diff --git a/drivers/usb/serial/io_edgeport.c b/drivers/usb/serial/io_edgeport.c index 89bb356..faedbeb 100644 --- a/drivers/usb/serial/io_edgeport.c +++ b/drivers/usb/serial/io_edgeport.c @@ -2353,7 +2353,7 @@ static int calc_baud_rate_divisor (int baudrate, int *divisor) dbg("%s - %d", __FUNCTION__, baudrate); - for (i = 0; i < NUM_ENTRIES(divisor_table); i++) { + for (i = 0; i < ARRAY_SIZE(divisor_table); i++) { if ( divisor_table[i].BaudRate == baudrate ) { *divisor = divisor_table[i].Divisor; return 0; -- cgit v1.1