aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/ezusb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/serial/ezusb.c')
-rw-r--r--drivers/usb/serial/ezusb.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/drivers/usb/serial/ezusb.c b/drivers/usb/serial/ezusb.c
index cc4fbd9d60be..711e84f6ed82 100644
--- a/drivers/usb/serial/ezusb.c
+++ b/drivers/usb/serial/ezusb.c
@@ -20,7 +20,8 @@
20/* EZ-USB Control and Status Register. Bit 0 controls 8051 reset */ 20/* EZ-USB Control and Status Register. Bit 0 controls 8051 reset */
21#define CPUCS_REG 0x7F92 21#define CPUCS_REG 0x7F92
22 22
23int ezusb_writememory (struct usb_serial *serial, int address, unsigned char *data, int length, __u8 bRequest) 23int ezusb_writememory(struct usb_serial *serial, int address,
24 unsigned char *data, int length, __u8 request)
24{ 25{
25 int result; 26 int result;
26 unsigned char *transfer_buffer; 27 unsigned char *transfer_buffer;
@@ -33,26 +34,27 @@ int ezusb_writememory (struct usb_serial *serial, int address, unsigned char *da
33 34
34 transfer_buffer = kmemdup(data, length, GFP_KERNEL); 35 transfer_buffer = kmemdup(data, length, GFP_KERNEL);
35 if (!transfer_buffer) { 36 if (!transfer_buffer) {
36 dev_err(&serial->dev->dev, "%s - kmalloc(%d) failed.\n", __func__, length); 37 dev_err(&serial->dev->dev, "%s - kmalloc(%d) failed.\n",
38 __func__, length);
37 return -ENOMEM; 39 return -ENOMEM;
38 } 40 }
39 result = usb_control_msg (serial->dev, usb_sndctrlpipe(serial->dev, 0), bRequest, 0x40, address, 0, transfer_buffer, length, 3000); 41 result = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0),
40 kfree (transfer_buffer); 42 request, 0x40, address, 0, transfer_buffer, length, 3000);
43 kfree(transfer_buffer);
41 return result; 44 return result;
42} 45}
46EXPORT_SYMBOL_GPL(ezusb_writememory);
43 47
44int ezusb_set_reset (struct usb_serial *serial, unsigned char reset_bit) 48int ezusb_set_reset(struct usb_serial *serial, unsigned char reset_bit)
45{ 49{
46 int response; 50 int response;
47 51
48 /* dbg("%s - %d", __func__, reset_bit); */ 52 /* dbg("%s - %d", __func__, reset_bit); */
49 response = ezusb_writememory (serial, CPUCS_REG, &reset_bit, 1, 0xa0); 53 response = ezusb_writememory(serial, CPUCS_REG, &reset_bit, 1, 0xa0);
50 if (response < 0) 54 if (response < 0)
51 dev_err(&serial->dev->dev, "%s- %d failed\n", __func__, reset_bit); 55 dev_err(&serial->dev->dev, "%s- %d failed\n",
56 __func__, reset_bit);
52 return response; 57 return response;
53} 58}
54
55
56EXPORT_SYMBOL_GPL(ezusb_writememory);
57EXPORT_SYMBOL_GPL(ezusb_set_reset); 59EXPORT_SYMBOL_GPL(ezusb_set_reset);
58 60