Merge branch 'for-davem' of git://gitorious.org/linux-can/linux-can-next

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>
This commit is contained in:
David S. Miller 2012-11-30 12:12:05 -05:00
commit fed2c6fd1f
9 changed files with 1 additions and 43 deletions

View File

@ -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);

View File

@ -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);
@ -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
@ -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);
@ -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;
}

View File

@ -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;

View File

@ -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);
@ -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);
@ -598,8 +592,6 @@ static int sja1000_close(struct net_device *dev)
close_candev(dev);
priv->open_time = 0;
return 0;
}

View File

@ -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 */

View File

@ -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];
@ -728,7 +727,6 @@ static int ems_usb_open(struct net_device *netdev)
return err;
}
dev->open_time = jiffies;
netif_start_queue(netdev);
@ -878,8 +876,6 @@ static int ems_usb_close(struct net_device *netdev)
close_candev(netdev);
dev->open_time = 0;
return 0;
}
@ -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))

View File

@ -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;
@ -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;
@ -864,8 +861,6 @@ static int esd_usb2_close(struct net_device *netdev)
close_candev(netdev);
priv->open_time = 0;
return 0;
}
@ -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);

View File

@ -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;
@ -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 */
@ -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);

View File

@ -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];