can: ems_usb: Removed double netif_device_detach
authorSebastian Haas <dev@sebastianhaas.info>
Thu, 22 Dec 2011 22:57:49 +0000 (23:57 +0100)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Fri, 3 Feb 2012 00:20:51 +0000 (01:20 +0100)
netif_device_attched is called twice when ems_usb_start fails with -ENODEV

Signed-off-by: Sebastian Haas <dev@sebastianhaas.info>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/usb/ems_usb.c

index 9697c14b8dc6b3dc4261894db49d59ec31a538dd..7dae64d44e83f70392ef13caad9cec152b480e5c 100644 (file)
@@ -627,9 +627,6 @@ static int ems_usb_start(struct ems_usb *dev)
 
                err = usb_submit_urb(urb, GFP_KERNEL);
                if (err) {
-                       if (err == -ENODEV)
-                               netif_device_detach(dev->netdev);
-
                        usb_unanchor_urb(urb);
                        usb_free_coherent(dev->udev, RX_BUFFER_SIZE, buf,
                                          urb->transfer_dma);
@@ -659,9 +656,6 @@ static int ems_usb_start(struct ems_usb *dev)
 
        err = usb_submit_urb(dev->intr_urb, GFP_KERNEL);
        if (err) {
-               if (err == -ENODEV)
-                       netif_device_detach(dev->netdev);
-
                dev_warn(netdev->dev.parent, "intr URB submit failed: %d\n",
                         err);
 
@@ -692,9 +686,6 @@ static int ems_usb_start(struct ems_usb *dev)
        return 0;
 
 failed:
-       if (err == -ENODEV)
-               netif_device_detach(dev->netdev);
-
        dev_warn(netdev->dev.parent, "couldn't submit control: %d\n", err);
 
        return err;