* [PATCH 2.4.9-ac16] usb serial compile error.
@ 2001-09-28 9:52 Stelian Pop
2001-09-28 16:55 ` Greg KH
0 siblings, 1 reply; 2+ messages in thread
From: Stelian Pop @ 2001-09-28 9:52 UTC (permalink / raw)
To: Linux Kernel Mailing List
When compiling a USB serial driver (mct_u232 in my case)
without USB generic serial support, the compile process
stops because of undefined 'vendor' and 'product'
symbols.
The attached patch corrects this issue.
Stelian.
--- linux-2.4.9-ac16/drivers/usb/serial/usbserial.c.orig Fri Sep 28 11:35:39 2001
+++ linux-2.4.9-ac16/drivers/usb/serial/usbserial.c Fri Sep 28 11:35:52 2001
@@ -323,11 +323,10 @@
static void generic_write_bulk_callback (struct urb *urb);
static void generic_shutdown (struct usb_serial *serial);
-
-#ifdef CONFIG_USB_SERIAL_GENERIC
static __u16 vendor = 0x05f9;
static __u16 product = 0xffff;
+#ifdef CONFIG_USB_SERIAL_GENERIC
static struct usb_device_id generic_device_ids[2]; /* Initially all zeroes. */
/* All of the device info needed for the Generic Serial Converter */
--
Stelian Pop <stelian.pop@fr.alcove.com>
|---------------- Free Software Engineer -----------------|
| Alcôve - http://www.alcove.com - Tel: +33 1 49 22 68 00 |
|------------- Alcôve, liberating software ---------------|
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 2.4.9-ac16] usb serial compile error.
2001-09-28 9:52 [PATCH 2.4.9-ac16] usb serial compile error Stelian Pop
@ 2001-09-28 16:55 ` Greg KH
0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2001-09-28 16:55 UTC (permalink / raw)
To: Linux Kernel Mailing List
[-- Attachment #1: Type: text/plain, Size: 362 bytes --]
On Fri, Sep 28, 2001 at 11:52:03AM +0200, Stelian Pop wrote:
> When compiling a USB serial driver (mct_u232 in my case)
> without USB generic serial support, the compile process
> stops because of undefined 'vendor' and 'product'
> symbols.
>
> The attached patch corrects this issue.
Here's a bit nicer patch, which has been sent to Alan.
thanks,
greg k-h
[-- Attachment #2: usb-serial-2.4.9-ac16.patch --]
[-- Type: text/plain, Size: 1391 bytes --]
diff --minimal -Nru a/drivers/usb/serial/usbserial.c b/drivers/usb/serial/usbserial.c
--- a/drivers/usb/serial/usbserial.c Fri Sep 28 09:51:10 2001
+++ b/drivers/usb/serial/usbserial.c Fri Sep 28 09:51:10 2001
@@ -307,7 +307,7 @@
/*
* Version Information
*/
-#define DRIVER_VERSION "v1.3"
+#define DRIVER_VERSION "v1.4"
#define DRIVER_AUTHOR "Greg Kroah-Hartman, greg@kroah.com, http://www.kroah.com/linux-usb/"
#define DRIVER_DESC "USB Serial Driver core"
@@ -343,6 +343,13 @@
num_ports: 1,
shutdown: generic_shutdown,
};
+
+#define if_generic_do(x) \
+ if ((serial->dev->descriptor.idVendor == vendor) && \
+ (serial->dev->descriptor.idProduct == product)) \
+ x
+#else
+#define if_generic_do(x)
#endif
@@ -765,9 +772,7 @@
return -ENODEV;
/* only increment our usage count, if this device is _really_ a generic device */
- if ((serial->dev->descriptor.idVendor == vendor) &&
- (serial->dev->descriptor.idProduct == product))
- MOD_INC_USE_COUNT;
+ if_generic_do(MOD_INC_USE_COUNT);
dbg(__FUNCTION__ " - port %d", port->number);
@@ -829,9 +834,7 @@
up (&port->sem);
/* only decrement our usage count, if this device is _really_ a generic device */
- if ((serial->dev->descriptor.idVendor == vendor) &&
- (serial->dev->descriptor.idProduct == product))
- MOD_DEC_USE_COUNT;
+ if_generic_do(MOD_DEC_USE_COUNT);
}
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2001-09-28 17:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-09-28 9:52 [PATCH 2.4.9-ac16] usb serial compile error Stelian Pop
2001-09-28 16:55 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox