aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/serial/pl2303.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
index 409000a836dd..7efb39cd6f74 100644
--- a/drivers/usb/serial/pl2303.c
+++ b/drivers/usb/serial/pl2303.c
@@ -177,7 +177,6 @@ static int pl2303_startup(struct usb_serial *serial)
177{ 177{
178 struct pl2303_serial_private *spriv; 178 struct pl2303_serial_private *spriv;
179 enum pl2303_type type = type_0; 179 enum pl2303_type type = type_0;
180 char *type_str = "unknown (treating as type_0)";
181 unsigned char *buf; 180 unsigned char *buf;
182 181
183 spriv = kzalloc(sizeof(*spriv), GFP_KERNEL); 182 spriv = kzalloc(sizeof(*spriv), GFP_KERNEL);
@@ -190,18 +189,14 @@ static int pl2303_startup(struct usb_serial *serial)
190 return -ENOMEM; 189 return -ENOMEM;
191 } 190 }
192 191
193 if (serial->dev->descriptor.bDeviceClass == 0x02) { 192 if (serial->dev->descriptor.bDeviceClass == 0x02)
194 type = type_0; 193 type = type_0;
195 type_str = "type_0"; 194 else if (serial->dev->descriptor.bMaxPacketSize0 == 0x40)
196 } else if (serial->dev->descriptor.bMaxPacketSize0 == 0x40) {
197 type = HX; 195 type = HX;
198 type_str = "X/HX"; 196 else if (serial->dev->descriptor.bDeviceClass == 0x00
199 } else if (serial->dev->descriptor.bDeviceClass == 0x00 197 || serial->dev->descriptor.bDeviceClass == 0xFF)
200 || serial->dev->descriptor.bDeviceClass == 0xFF) {
201 type = type_1; 198 type = type_1;
202 type_str = "type_1"; 199 dev_dbg(&serial->interface->dev, "device type: %d\n", type);
203 }
204 dev_dbg(&serial->interface->dev, "device type: %s\n", type_str);
205 200
206 spriv->type = type; 201 spriv->type = type;
207 usb_set_serial_data(serial, spriv); 202 usb_set_serial_data(serial, spriv);