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>
This commit is contained in:
parent
ab48b03ec9
commit
49ed59b72c
2 changed files with 0 additions and 9 deletions
|
@ -517,12 +517,8 @@ static irqreturn_t mscan_isr(int irq, void *dev_id)
|
||||||
|
|
||||||
static int mscan_do_set_mode(struct net_device *dev, enum can_mode mode)
|
static int mscan_do_set_mode(struct net_device *dev, enum can_mode mode)
|
||||||
{
|
{
|
||||||
struct mscan_priv *priv = netdev_priv(dev);
|
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
if (!priv->open_time)
|
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case CAN_MODE_START:
|
case CAN_MODE_START:
|
||||||
ret = mscan_restart(dev);
|
ret = mscan_restart(dev);
|
||||||
|
@ -590,8 +586,6 @@ static int mscan_open(struct net_device *dev)
|
||||||
goto exit_napi_disable;
|
goto exit_napi_disable;
|
||||||
}
|
}
|
||||||
|
|
||||||
priv->open_time = jiffies;
|
|
||||||
|
|
||||||
if (priv->can.ctrlmode & CAN_CTRLMODE_LISTENONLY)
|
if (priv->can.ctrlmode & CAN_CTRLMODE_LISTENONLY)
|
||||||
setbits8(®s->canctl1, MSCAN_LISTEN);
|
setbits8(®s->canctl1, MSCAN_LISTEN);
|
||||||
else
|
else
|
||||||
|
@ -606,7 +600,6 @@ static int mscan_open(struct net_device *dev)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
exit_free_irq:
|
exit_free_irq:
|
||||||
priv->open_time = 0;
|
|
||||||
free_irq(dev->irq, dev);
|
free_irq(dev->irq, dev);
|
||||||
exit_napi_disable:
|
exit_napi_disable:
|
||||||
napi_disable(&priv->napi);
|
napi_disable(&priv->napi);
|
||||||
|
@ -627,7 +620,6 @@ static int mscan_close(struct net_device *dev)
|
||||||
mscan_set_mode(dev, MSCAN_INIT_MODE);
|
mscan_set_mode(dev, MSCAN_INIT_MODE);
|
||||||
close_candev(dev);
|
close_candev(dev);
|
||||||
free_irq(dev->irq, dev);
|
free_irq(dev->irq, dev);
|
||||||
priv->open_time = 0;
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -281,7 +281,6 @@ struct tx_queue_entry {
|
||||||
struct mscan_priv {
|
struct mscan_priv {
|
||||||
struct can_priv can; /* must be the first member */
|
struct can_priv can; /* must be the first member */
|
||||||
unsigned int type; /* MSCAN type variants */
|
unsigned int type; /* MSCAN type variants */
|
||||||
long open_time;
|
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
void __iomem *reg_base; /* ioremap'ed address to registers */
|
void __iomem *reg_base; /* ioremap'ed address to registers */
|
||||||
u8 shadow_statflg;
|
u8 shadow_statflg;
|
||||||
|
|
Loading…
Add table
Reference in a new issue