cp210x.c (681e4a5e13c1c8315694eb4f44e0cdd84c9082d2) cp210x.c (2d5733fcd33dd451022d197cb6b476e970519ca7)
1/*
2 * Silicon Laboratories CP210x USB to RS232 serial adaptor driver
3 *
4 * Copyright (C) 2005 Craig Shelley (craig@microtron.org.uk)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License version
8 * 2 as published by the Free Software Foundation.

--- 273 unchanged lines hidden (view full) ---

282 if (!buf) {
283 dev_err(&port->dev, "%s - out of memory.\n", __func__);
284 return -ENOMEM;
285 }
286
287 /* Issue the request, attempting to read 'size' bytes */
288 result = usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0),
289 request, REQTYPE_DEVICE_TO_HOST, 0x0000,
1/*
2 * Silicon Laboratories CP210x USB to RS232 serial adaptor driver
3 *
4 * Copyright (C) 2005 Craig Shelley (craig@microtron.org.uk)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License version
8 * 2 as published by the Free Software Foundation.

--- 273 unchanged lines hidden (view full) ---

282 if (!buf) {
283 dev_err(&port->dev, "%s - out of memory.\n", __func__);
284 return -ENOMEM;
285 }
286
287 /* Issue the request, attempting to read 'size' bytes */
288 result = usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0),
289 request, REQTYPE_DEVICE_TO_HOST, 0x0000,
290 port_priv->bInterfaceNumber, buf, size, 300);
290 port_priv->bInterfaceNumber, buf, size,
291 USB_CTRL_GET_TIMEOUT);
291
292 /* Convert data into an array of integers */
293 for (i = 0; i < length; i++)
294 data[i] = le32_to_cpu(buf[i]);
295
296 kfree(buf);
297
298 if (result != size) {

--- 36 unchanged lines hidden (view full) ---

335 /* Array of integers into bytes */
336 for (i = 0; i < length; i++)
337 buf[i] = cpu_to_le32(data[i]);
338
339 if (size > 2) {
340 result = usb_control_msg(serial->dev,
341 usb_sndctrlpipe(serial->dev, 0),
342 request, REQTYPE_HOST_TO_DEVICE, 0x0000,
292
293 /* Convert data into an array of integers */
294 for (i = 0; i < length; i++)
295 data[i] = le32_to_cpu(buf[i]);
296
297 kfree(buf);
298
299 if (result != size) {

--- 36 unchanged lines hidden (view full) ---

336 /* Array of integers into bytes */
337 for (i = 0; i < length; i++)
338 buf[i] = cpu_to_le32(data[i]);
339
340 if (size > 2) {
341 result = usb_control_msg(serial->dev,
342 usb_sndctrlpipe(serial->dev, 0),
343 request, REQTYPE_HOST_TO_DEVICE, 0x0000,
343 port_priv->bInterfaceNumber, buf, size, 300);
344 port_priv->bInterfaceNumber, buf, size,
345 USB_CTRL_SET_TIMEOUT);
344 } else {
345 result = usb_control_msg(serial->dev,
346 usb_sndctrlpipe(serial->dev, 0),
347 request, REQTYPE_HOST_TO_DEVICE, data[0],
346 } else {
347 result = usb_control_msg(serial->dev,
348 usb_sndctrlpipe(serial->dev, 0),
349 request, REQTYPE_HOST_TO_DEVICE, data[0],
348 port_priv->bInterfaceNumber, NULL, 0, 300);
350 port_priv->bInterfaceNumber, NULL, 0,
351 USB_CTRL_SET_TIMEOUT);
349 }
350
351 kfree(buf);
352
353 if ((size > 2 && result != size) || result < 0) {
354 dbg("%s - Unable to send request, "
355 "request=0x%x size=%d result=%d",
356 __func__, request, size, result);

--- 542 unchanged lines hidden ---
352 }
353
354 kfree(buf);
355
356 if ((size > 2 && result != size) || result < 0) {
357 dbg("%s - Unable to send request, "
358 "request=0x%x size=%d result=%d",
359 __func__, request, size, result);

--- 542 unchanged lines hidden ---