~ubuntu-branches/ubuntu/saucy/linux-ti-omap4/saucy

« back to all changes in this revision

Viewing changes to drivers/usb/serial/mos7720.c

  • Committer: Package Import Robot
  • Author(s): Paolo Pisati, Paolo Pisati
  • Date: 2013-07-11 18:35:20 UTC
  • Revision ID: package-import@ubuntu.com-20130711183520-htnf1x4y5r11hndr
Tags: 3.5.0-229.42
* Release Tracking Bug
  - LP: #1199276

[ Paolo Pisati ]

* [Config] CONFIG_ATH9K_LEGACY_RATE_CONTROL is not set

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
#define DRIVER_DESC "Moschip USB Serial Driver"
45
45
 
46
46
/* default urb timeout */
47
 
#define MOS_WDR_TIMEOUT (HZ * 5)
 
47
#define MOS_WDR_TIMEOUT 5000
48
48
 
49
49
#define MOS_MAX_PORT    0x02
50
50
#define MOS_WRITE       0x0E
234
234
        __u8 requesttype = (__u8)0xc0;
235
235
        __u16 index = get_reg_index(reg);
236
236
        __u16 value = get_reg_value(reg, serial_portnum);
237
 
        int status = usb_control_msg(usbdev, pipe, request, requesttype, value,
238
 
                                     index, data, 1, MOS_WDR_TIMEOUT);
239
 
        if (status < 0)
 
237
        u8 *buf;
 
238
        int status;
 
239
 
 
240
        buf = kmalloc(1, GFP_KERNEL);
 
241
        if (!buf)
 
242
                return -ENOMEM;
 
243
 
 
244
        status = usb_control_msg(usbdev, pipe, request, requesttype, value,
 
245
                                     index, buf, 1, MOS_WDR_TIMEOUT);
 
246
        if (status == 1)
 
247
                *data = *buf;
 
248
        else if (status < 0)
240
249
                dev_err(&usbdev->dev,
241
250
                        "mos7720: usb_control_msg() failed: %d", status);
 
251
        kfree(buf);
 
252
 
242
253
        return status;
243
254
}
244
255
 
1684
1695
                mos7720_port->shadowMCR |= (UART_MCR_XONANY);
1685
1696
                /* To set hardware flow control to the specified *
1686
1697
                 * serial port, in SP1/2_CONTROL_REG             */
1687
 
                if (port->number)
 
1698
                if (port_number)
1688
1699
                        write_mos_reg(serial, dummy, SP_CONTROL_REG, 0x01);
1689
1700
                else
1690
1701
                        write_mos_reg(serial, dummy, SP_CONTROL_REG, 0x02);
2088
2099
 
2089
2100
        /* setting configuration feature to one */
2090
2101
        usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0),
2091
 
                        (__u8)0x03, 0x00, 0x01, 0x00, NULL, 0x00, 5*HZ);
 
2102
                        (__u8)0x03, 0x00, 0x01, 0x00, NULL, 0x00, 5000);
2092
2103
 
2093
2104
        /* start the interrupt urb */
2094
2105
        ret_val = usb_submit_urb(serial->port[0]->interrupt_in_urb, GFP_KERNEL);
2133
2144
                /* wait for synchronous usb calls to return */
2134
2145
                if (mos_parport->msg_pending)
2135
2146
                        wait_for_completion_timeout(&mos_parport->syncmsg_compl,
2136
 
                                                    MOS_WDR_TIMEOUT);
 
2147
                                            msecs_to_jiffies(MOS_WDR_TIMEOUT));
2137
2148
 
2138
2149
                parport_remove_port(mos_parport->pp);
2139
2150
                usb_set_serial_data(serial, NULL);