Commit 823d7a1f authored by Marc Kleine-Budde's avatar Marc Kleine-Budde

can: pcan_usb_core: remove obsolete variable open_time

The variable open_time in the struct peak_usb_device was used to protect
peak_usb_set_mode() only to be called, if the interface is up. Now the CAN
device infrastructure takes care of this.
Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
parent e4287046
...@@ -520,7 +520,6 @@ static int peak_usb_ndo_open(struct net_device *netdev) ...@@ -520,7 +520,6 @@ static int peak_usb_ndo_open(struct net_device *netdev)
return err; return err;
} }
dev->open_time = jiffies;
netif_start_queue(netdev); netif_start_queue(netdev);
return 0; return 0;
...@@ -576,7 +575,6 @@ static int peak_usb_ndo_stop(struct net_device *netdev) ...@@ -576,7 +575,6 @@ static int peak_usb_ndo_stop(struct net_device *netdev)
close_candev(netdev); close_candev(netdev);
dev->open_time = 0;
dev->can.state = CAN_STATE_STOPPED; dev->can.state = CAN_STATE_STOPPED;
/* can set bus off now */ /* can set bus off now */
...@@ -661,9 +659,6 @@ static int peak_usb_set_mode(struct net_device *netdev, enum can_mode mode) ...@@ -661,9 +659,6 @@ static int peak_usb_set_mode(struct net_device *netdev, enum can_mode mode)
struct peak_usb_device *dev = netdev_priv(netdev); struct peak_usb_device *dev = netdev_priv(netdev);
int err = 0; int err = 0;
if (!dev->open_time)
return -EINVAL;
switch (mode) { switch (mode) {
case CAN_MODE_START: case CAN_MODE_START:
err = peak_usb_restart(dev); err = peak_usb_restart(dev);
......
...@@ -104,7 +104,6 @@ struct peak_usb_device { ...@@ -104,7 +104,6 @@ struct peak_usb_device {
struct can_priv can; struct can_priv can;
struct peak_usb_adapter *adapter; struct peak_usb_adapter *adapter;
unsigned int ctrl_idx; unsigned int ctrl_idx;
int open_time;
u32 state; u32 state;
struct sk_buff *echo_skb[PCAN_USB_MAX_TX_URBS]; struct sk_buff *echo_skb[PCAN_USB_MAX_TX_URBS];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment