net: micrel: convert tasklets to use new tasklet_setup() API
In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly. Signed-off-by: Romain Perier <romain.perier@gmail.com> Signed-off-by: Allen Pais <apais@linux.microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Родитель
a1be161a3c
Коммит
9ad5a250a9
|
@ -587,10 +587,10 @@ out:
|
|||
return err;
|
||||
}
|
||||
|
||||
static void ks8842_rx_frame_dma_tasklet(unsigned long arg)
|
||||
static void ks8842_rx_frame_dma_tasklet(struct tasklet_struct *t)
|
||||
{
|
||||
struct net_device *netdev = (struct net_device *)arg;
|
||||
struct ks8842_adapter *adapter = netdev_priv(netdev);
|
||||
struct ks8842_adapter *adapter = from_tasklet(adapter, t, dma_rx.tasklet);
|
||||
struct net_device *netdev = adapter->netdev;
|
||||
struct ks8842_rx_dma_ctl *ctl = &adapter->dma_rx;
|
||||
struct sk_buff *skb = ctl->skb;
|
||||
dma_addr_t addr = sg_dma_address(&ctl->sg);
|
||||
|
@ -720,10 +720,10 @@ static void ks8842_handle_rx_overrun(struct net_device *netdev,
|
|||
netdev->stats.rx_fifo_errors++;
|
||||
}
|
||||
|
||||
static void ks8842_tasklet(unsigned long arg)
|
||||
static void ks8842_tasklet(struct tasklet_struct *t)
|
||||
{
|
||||
struct net_device *netdev = (struct net_device *)arg;
|
||||
struct ks8842_adapter *adapter = netdev_priv(netdev);
|
||||
struct ks8842_adapter *adapter = from_tasklet(adapter, t, tasklet);
|
||||
struct net_device *netdev = adapter->netdev;
|
||||
u16 isr;
|
||||
unsigned long flags;
|
||||
u16 entry_bank;
|
||||
|
@ -953,8 +953,7 @@ static int ks8842_alloc_dma_bufs(struct net_device *netdev)
|
|||
goto err;
|
||||
}
|
||||
|
||||
tasklet_init(&rx_ctl->tasklet, ks8842_rx_frame_dma_tasklet,
|
||||
(unsigned long)netdev);
|
||||
tasklet_setup(&rx_ctl->tasklet, ks8842_rx_frame_dma_tasklet);
|
||||
|
||||
return 0;
|
||||
err:
|
||||
|
@ -1173,7 +1172,7 @@ static int ks8842_probe(struct platform_device *pdev)
|
|||
adapter->dma_tx.channel = -1;
|
||||
}
|
||||
|
||||
tasklet_init(&adapter->tasklet, ks8842_tasklet, (unsigned long)netdev);
|
||||
tasklet_setup(&adapter->tasklet, ks8842_tasklet);
|
||||
spin_lock_init(&adapter->lock);
|
||||
|
||||
netdev->netdev_ops = &ks8842_netdev_ops;
|
||||
|
|
|
@ -5159,9 +5159,9 @@ release_packet:
|
|||
return received;
|
||||
}
|
||||
|
||||
static void rx_proc_task(unsigned long data)
|
||||
static void rx_proc_task(struct tasklet_struct *t)
|
||||
{
|
||||
struct dev_info *hw_priv = (struct dev_info *) data;
|
||||
struct dev_info *hw_priv = from_tasklet(hw_priv, t, rx_tasklet);
|
||||
struct ksz_hw *hw = &hw_priv->hw;
|
||||
|
||||
if (!hw->enabled)
|
||||
|
@ -5181,9 +5181,9 @@ static void rx_proc_task(unsigned long data)
|
|||
}
|
||||
}
|
||||
|
||||
static void tx_proc_task(unsigned long data)
|
||||
static void tx_proc_task(struct tasklet_struct *t)
|
||||
{
|
||||
struct dev_info *hw_priv = (struct dev_info *) data;
|
||||
struct dev_info *hw_priv = from_tasklet(hw_priv, t, tx_tasklet);
|
||||
struct ksz_hw *hw = &hw_priv->hw;
|
||||
|
||||
hw_ack_intr(hw, KS884X_INT_TX_MASK);
|
||||
|
@ -5436,10 +5436,8 @@ static int prepare_hardware(struct net_device *dev)
|
|||
rc = request_irq(dev->irq, netdev_intr, IRQF_SHARED, dev->name, dev);
|
||||
if (rc)
|
||||
return rc;
|
||||
tasklet_init(&hw_priv->rx_tasklet, rx_proc_task,
|
||||
(unsigned long) hw_priv);
|
||||
tasklet_init(&hw_priv->tx_tasklet, tx_proc_task,
|
||||
(unsigned long) hw_priv);
|
||||
tasklet_setup(&hw_priv->rx_tasklet, rx_proc_task);
|
||||
tasklet_setup(&hw_priv->tx_tasklet, tx_proc_task);
|
||||
|
||||
hw->promiscuous = 0;
|
||||
hw->all_multi = 0;
|
||||
|
|
Загрузка…
Ссылка в новой задаче