Updated from Linux LTS 3.10.20 to 3.10.21
This commit is contained in:
@@ -814,9 +814,6 @@ static int c_can_do_rx_poll(struct net_device *dev, int quota)
|
||||
msg_ctrl_save = priv->read_reg(priv,
|
||||
C_CAN_IFACE(MSGCTRL_REG, 0));
|
||||
|
||||
if (msg_ctrl_save & IF_MCONT_EOB)
|
||||
return num_rx_pkts;
|
||||
|
||||
if (msg_ctrl_save & IF_MCONT_MSGLST) {
|
||||
c_can_handle_lost_msg_obj(dev, 0, msg_obj);
|
||||
num_rx_pkts++;
|
||||
@@ -824,6 +821,9 @@ static int c_can_do_rx_poll(struct net_device *dev, int quota)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (msg_ctrl_save & IF_MCONT_EOB)
|
||||
return num_rx_pkts;
|
||||
|
||||
if (!(msg_ctrl_save & IF_MCONT_NEWDAT))
|
||||
continue;
|
||||
|
||||
|
||||
@@ -1544,9 +1544,9 @@ static int kvaser_usb_init_one(struct usb_interface *intf,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void kvaser_usb_get_endpoints(const struct usb_interface *intf,
|
||||
struct usb_endpoint_descriptor **in,
|
||||
struct usb_endpoint_descriptor **out)
|
||||
static int kvaser_usb_get_endpoints(const struct usb_interface *intf,
|
||||
struct usb_endpoint_descriptor **in,
|
||||
struct usb_endpoint_descriptor **out)
|
||||
{
|
||||
const struct usb_host_interface *iface_desc;
|
||||
struct usb_endpoint_descriptor *endpoint;
|
||||
@@ -1557,12 +1557,18 @@ static void kvaser_usb_get_endpoints(const struct usb_interface *intf,
|
||||
for (i = 0; i < iface_desc->desc.bNumEndpoints; ++i) {
|
||||
endpoint = &iface_desc->endpoint[i].desc;
|
||||
|
||||
if (usb_endpoint_is_bulk_in(endpoint))
|
||||
if (!*in && usb_endpoint_is_bulk_in(endpoint))
|
||||
*in = endpoint;
|
||||
|
||||
if (usb_endpoint_is_bulk_out(endpoint))
|
||||
if (!*out && usb_endpoint_is_bulk_out(endpoint))
|
||||
*out = endpoint;
|
||||
|
||||
/* use first bulk endpoint for in and out */
|
||||
if (*in && *out)
|
||||
return 0;
|
||||
}
|
||||
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
static int kvaser_usb_probe(struct usb_interface *intf,
|
||||
@@ -1576,8 +1582,8 @@ static int kvaser_usb_probe(struct usb_interface *intf,
|
||||
if (!dev)
|
||||
return -ENOMEM;
|
||||
|
||||
kvaser_usb_get_endpoints(intf, &dev->bulk_in, &dev->bulk_out);
|
||||
if (!dev->bulk_in || !dev->bulk_out) {
|
||||
err = kvaser_usb_get_endpoints(intf, &dev->bulk_in, &dev->bulk_out);
|
||||
if (err) {
|
||||
dev_err(&intf->dev, "Cannot get usb endpoint(s)");
|
||||
return err;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user