aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/can
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/can')
-rw-r--r--drivers/net/can/mscan/mscan.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/net/can/mscan/mscan.c b/drivers/net/can/mscan/mscan.c
index 263d1a9f0880..bb06dfb58f25 100644
--- a/drivers/net/can/mscan/mscan.c
+++ b/drivers/net/can/mscan/mscan.c
@@ -542,10 +542,8 @@ static int mscan_open(struct net_device *dev)
542 542
543 ret = request_irq(dev->irq, mscan_isr, 0, dev->name, dev); 543 ret = request_irq(dev->irq, mscan_isr, 0, dev->name, dev);
544 if (ret < 0) { 544 if (ret < 0) {
545 napi_disable(&priv->napi); 545 dev_err(dev->dev.parent, "failed to attach interrupt\n");
546 printk(KERN_ERR "%s - failed to attach interrupt\n", 546 goto exit_napi_disable;
547 dev->name);
548 return ret;
549 } 547 }
550 548
551 priv->open_time = jiffies; 549 priv->open_time = jiffies;
@@ -554,11 +552,19 @@ static int mscan_open(struct net_device *dev)
554 552
555 ret = mscan_start(dev); 553 ret = mscan_start(dev);
556 if (ret) 554 if (ret)
557 return ret; 555 goto exit_free_irq;
558 556
559 netif_start_queue(dev); 557 netif_start_queue(dev);
560 558
561 return 0; 559 return 0;
560
561exit_free_irq:
562 priv->open_time = 0;
563 free_irq(dev->irq, dev);
564exit_napi_disable:
565 napi_disable(&priv->napi);
566 close_candev(dev);
567 return ret;
562} 568}
563 569
564static int mscan_close(struct net_device *dev) 570static int mscan_close(struct net_device *dev)