Skip to content

Commit

Permalink
Merge branch 'for-davem' of git://gitorious.org/linux-can/linux-can-next
Browse files Browse the repository at this point in the history
Marc Kleine-Budde says:

====================
this pull request is for net-next/master. There is a patch by Alexander
Stein fixing a reference counter problem which can make driver
unloading impossible (stable Cc'ed). And several patches by me which
remove an obsolete mechanism from several drivers, which is already
handled at the infrastructure level.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Nov 30, 2012
2 parents 481af03 + 823d7a1 commit fed2c6f
Show file tree
Hide file tree
Showing 9 changed files with 1 addition and 43 deletions.
3 changes: 1 addition & 2 deletions drivers/net/can/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -609,8 +609,7 @@ void close_candev(struct net_device *dev)
{
struct can_priv *priv = netdev_priv(dev);

if (del_timer_sync(&priv->restart_timer))
dev_put(dev);
del_timer_sync(&priv->restart_timer);
can_flush_echo_skb(dev);
}
EXPORT_SYMBOL_GPL(close_candev);
Expand Down
8 changes: 0 additions & 8 deletions drivers/net/can/mscan/mscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
struct mscan_priv *priv = netdev_priv(dev);
int ret = 0;

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

switch (mode) {
case CAN_MODE_START:
ret = mscan_restart(dev);
Expand Down Expand Up @@ -590,8 +586,6 @@ static int mscan_open(struct net_device *dev)
goto exit_napi_disable;
}

priv->open_time = jiffies;

if (priv->can.ctrlmode & CAN_CTRLMODE_LISTENONLY)
setbits8(&regs->canctl1, MSCAN_LISTEN);
else
Expand All @@ -606,7 +600,6 @@ static int mscan_open(struct net_device *dev)
return 0;

exit_free_irq:
priv->open_time = 0;
free_irq(dev->irq, dev);
exit_napi_disable:
napi_disable(&priv->napi);
Expand All @@ -627,7 +620,6 @@ static int mscan_close(struct net_device *dev)
mscan_set_mode(dev, MSCAN_INIT_MODE);
close_candev(dev);
free_irq(dev->irq, dev);
priv->open_time = 0;

return 0;
}
Expand Down
1 change: 0 additions & 1 deletion drivers/net/can/mscan/mscan.h
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,6 @@ struct tx_queue_entry {
struct mscan_priv {
struct can_priv can; /* must be the first member */
unsigned int type; /* MSCAN type variants */
long open_time;
unsigned long flags;
void __iomem *reg_base; /* ioremap'ed address to registers */
u8 shadow_statflg;
Expand Down
8 changes: 0 additions & 8 deletions drivers/net/can/sja1000/sja1000.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,6 @@ static void sja1000_start(struct net_device *dev)

static int sja1000_set_mode(struct net_device *dev, enum can_mode mode)
{
struct sja1000_priv *priv = netdev_priv(dev);

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

switch (mode) {
case CAN_MODE_START:
sja1000_start(dev);
Expand Down Expand Up @@ -579,7 +574,6 @@ static int sja1000_open(struct net_device *dev)

/* init and start chi */
sja1000_start(dev);
priv->open_time = jiffies;

netif_start_queue(dev);

Expand All @@ -598,8 +592,6 @@ static int sja1000_close(struct net_device *dev)

close_candev(dev);

priv->open_time = 0;

return 0;
}

Expand Down
1 change: 0 additions & 1 deletion drivers/net/can/sja1000/sja1000.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@
*/
struct sja1000_priv {
struct can_priv can; /* must be the first member */
int open_time;
struct sk_buff *echo_skb;

/* the lower-layer is responsible for appropriate locking */
Expand Down
7 changes: 0 additions & 7 deletions drivers/net/can/usb/ems_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@ struct ems_tx_urb_context {

struct ems_usb {
struct can_priv can; /* must be the first member */
int open_time;

struct sk_buff *echo_skb[MAX_TX_URBS];

Expand Down Expand Up @@ -728,7 +727,6 @@ static int ems_usb_open(struct net_device *netdev)
return err;
}

dev->open_time = jiffies;

netif_start_queue(netdev);

Expand Down Expand Up @@ -878,8 +876,6 @@ static int ems_usb_close(struct net_device *netdev)

close_candev(netdev);

dev->open_time = 0;

return 0;
}

Expand All @@ -905,9 +901,6 @@ static int ems_usb_set_mode(struct net_device *netdev, enum can_mode mode)
{
struct ems_usb *dev = netdev_priv(netdev);

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

switch (mode) {
case CAN_MODE_START:
if (ems_usb_write_mode(dev, SJA1000_MOD_NORMAL))
Expand Down
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
5 changes: 0 additions & 5 deletions drivers/net/can/usb/peak_usb/pcan_usb_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,6 @@ static int peak_usb_ndo_open(struct net_device *netdev)
return err;
}

dev->open_time = jiffies;
netif_start_queue(netdev);

return 0;
Expand Down Expand Up @@ -576,7 +575,6 @@ static int peak_usb_ndo_stop(struct net_device *netdev)

close_candev(netdev);

dev->open_time = 0;
dev->can.state = CAN_STATE_STOPPED;

/* can set bus off now */
Expand Down Expand Up @@ -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);
int err = 0;

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

switch (mode) {
case CAN_MODE_START:
err = peak_usb_restart(dev);
Expand Down
1 change: 0 additions & 1 deletion drivers/net/can/usb/peak_usb/pcan_usb_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ struct peak_usb_device {
struct can_priv can;
struct peak_usb_adapter *adapter;
unsigned int ctrl_idx;
int open_time;
u32 state;

struct sk_buff *echo_skb[PCAN_USB_MAX_TX_URBS];
Expand Down

0 comments on commit fed2c6f

Please sign in to comment.