Skip to content

Commit

Permalink
can: esd_usb2: remove obsolete variable open_time
Browse files Browse the repository at this point in the history
The variable open_time in the struct esd_usb2_net_priv was used to protect
esd_usb2_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>
  • Loading branch information
Marc Kleine-Budde committed Nov 29, 2012
1 parent 4480c00 commit e428704
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions drivers/net/can/usb/esd_usb2.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@ struct esd_usb2_net_priv {
struct usb_anchor tx_submitted;
struct esd_tx_urb_context tx_contexts[MAX_TX_URBS];

int open_time;
struct esd_usb2 *usb2;
struct net_device *netdev;
int index;
Expand Down Expand Up @@ -695,8 +694,6 @@ static int esd_usb2_open(struct net_device *netdev)
return err;
}

priv->open_time = jiffies;

netif_start_queue(netdev);

return 0;
Expand Down Expand Up @@ -864,8 +861,6 @@ static int esd_usb2_close(struct net_device *netdev)

close_candev(netdev);

priv->open_time = 0;

return 0;
}

Expand Down Expand Up @@ -941,11 +936,6 @@ static int esd_usb2_get_berr_counter(const struct net_device *netdev,

static int esd_usb2_set_mode(struct net_device *netdev, enum can_mode mode)
{
struct esd_usb2_net_priv *priv = netdev_priv(netdev);

if (!priv->open_time)
return -EINVAL;

switch (mode) {
case CAN_MODE_START:
netif_wake_queue(netdev);
Expand Down

0 comments on commit e428704

Please sign in to comment.