diff options
author | Marc Kleine-Budde <mkl@pengutronix.de> | 2012-07-20 16:30:40 -0400 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2012-11-29 08:30:34 -0500 |
commit | 49ed59b72cb03116682dd6ab5c04117cc710bff3 (patch) | |
tree | 189ef280cb0bc7485d07cc6fe94cb6c509ebcacd /drivers/net/can | |
parent | ab48b03ec9ae1840a1e427e2375bd0d9d554b4ed (diff) |
can: mscan: remove obsolete variable open_time
The variable open_time in the struct mscan_priv was used to protect
mscan_do_set_mode() only to be called, if the interface is up. Now the CAN
device infrastructure takes care of this.
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers/net/can')
-rw-r--r-- | drivers/net/can/mscan/mscan.c | 8 | ||||
-rw-r--r-- | drivers/net/can/mscan/mscan.h | 1 |
2 files changed, 0 insertions, 9 deletions
diff --git a/drivers/net/can/mscan/mscan.c b/drivers/net/can/mscan/mscan.c index 2b104d5f422c..e6b40954e204 100644 --- a/drivers/net/can/mscan/mscan.c +++ b/drivers/net/can/mscan/mscan.c | |||
@@ -517,12 +517,8 @@ static irqreturn_t mscan_isr(int irq, void *dev_id) | |||
517 | 517 | ||
518 | static int mscan_do_set_mode(struct net_device *dev, enum can_mode mode) | 518 | static int mscan_do_set_mode(struct net_device *dev, enum can_mode mode) |
519 | { | 519 | { |
520 | struct mscan_priv *priv = netdev_priv(dev); | ||
521 | int ret = 0; | 520 | int ret = 0; |
522 | 521 | ||
523 | if (!priv->open_time) | ||
524 | return -EINVAL; | ||
525 | |||
526 | switch (mode) { | 522 | switch (mode) { |
527 | case CAN_MODE_START: | 523 | case CAN_MODE_START: |
528 | ret = mscan_restart(dev); | 524 | ret = mscan_restart(dev); |
@@ -590,8 +586,6 @@ static int mscan_open(struct net_device *dev) | |||
590 | goto exit_napi_disable; | 586 | goto exit_napi_disable; |
591 | } | 587 | } |
592 | 588 | ||
593 | priv->open_time = jiffies; | ||
594 | |||
595 | if (priv->can.ctrlmode & CAN_CTRLMODE_LISTENONLY) | 589 | if (priv->can.ctrlmode & CAN_CTRLMODE_LISTENONLY) |
596 | setbits8(®s->canctl1, MSCAN_LISTEN); | 590 | setbits8(®s->canctl1, MSCAN_LISTEN); |
597 | else | 591 | else |
@@ -606,7 +600,6 @@ static int mscan_open(struct net_device *dev) | |||
606 | return 0; | 600 | return 0; |
607 | 601 | ||
608 | exit_free_irq: | 602 | exit_free_irq: |
609 | priv->open_time = 0; | ||
610 | free_irq(dev->irq, dev); | 603 | free_irq(dev->irq, dev); |
611 | exit_napi_disable: | 604 | exit_napi_disable: |
612 | napi_disable(&priv->napi); | 605 | napi_disable(&priv->napi); |
@@ -627,7 +620,6 @@ static int mscan_close(struct net_device *dev) | |||
627 | mscan_set_mode(dev, MSCAN_INIT_MODE); | 620 | mscan_set_mode(dev, MSCAN_INIT_MODE); |
628 | close_candev(dev); | 621 | close_candev(dev); |
629 | free_irq(dev->irq, dev); | 622 | free_irq(dev->irq, dev); |
630 | priv->open_time = 0; | ||
631 | 623 | ||
632 | return 0; | 624 | return 0; |
633 | } | 625 | } |
diff --git a/drivers/net/can/mscan/mscan.h b/drivers/net/can/mscan/mscan.h index b43e9f5d3268..af2ed8baf0a3 100644 --- a/drivers/net/can/mscan/mscan.h +++ b/drivers/net/can/mscan/mscan.h | |||
@@ -281,7 +281,6 @@ struct tx_queue_entry { | |||
281 | struct mscan_priv { | 281 | struct mscan_priv { |
282 | struct can_priv can; /* must be the first member */ | 282 | struct can_priv can; /* must be the first member */ |
283 | unsigned int type; /* MSCAN type variants */ | 283 | unsigned int type; /* MSCAN type variants */ |
284 | long open_time; | ||
285 | unsigned long flags; | 284 | unsigned long flags; |
286 | void __iomem *reg_base; /* ioremap'ed address to registers */ | 285 | void __iomem *reg_base; /* ioremap'ed address to registers */ |
287 | u8 shadow_statflg; | 286 | u8 shadow_statflg; |