提交 4c58700a 编写于 作者: A Allen Pais 提交者: David S. Miller

net: amd-xgbe: 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: NRomain Perier <romain.perier@gmail.com>
Signed-off-by: NAllen Pais <apais@linux.microsoft.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 9c59cc79
...@@ -403,9 +403,9 @@ static bool xgbe_ecc_ded(struct xgbe_prv_data *pdata, unsigned long *period, ...@@ -403,9 +403,9 @@ static bool xgbe_ecc_ded(struct xgbe_prv_data *pdata, unsigned long *period,
return false; return false;
} }
static void xgbe_ecc_isr_task(unsigned long data) static void xgbe_ecc_isr_task(struct tasklet_struct *t)
{ {
struct xgbe_prv_data *pdata = (struct xgbe_prv_data *)data; struct xgbe_prv_data *pdata = from_tasklet(pdata, t, tasklet_ecc);
unsigned int ecc_isr; unsigned int ecc_isr;
bool stop = false; bool stop = false;
...@@ -468,14 +468,14 @@ static irqreturn_t xgbe_ecc_isr(int irq, void *data) ...@@ -468,14 +468,14 @@ static irqreturn_t xgbe_ecc_isr(int irq, void *data)
if (pdata->isr_as_tasklet) if (pdata->isr_as_tasklet)
tasklet_schedule(&pdata->tasklet_ecc); tasklet_schedule(&pdata->tasklet_ecc);
else else
xgbe_ecc_isr_task((unsigned long)pdata); xgbe_ecc_isr_task(&pdata->tasklet_ecc);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
static void xgbe_isr_task(unsigned long data) static void xgbe_isr_task(struct tasklet_struct *t)
{ {
struct xgbe_prv_data *pdata = (struct xgbe_prv_data *)data; struct xgbe_prv_data *pdata = from_tasklet(pdata, t, tasklet_dev);
struct xgbe_hw_if *hw_if = &pdata->hw_if; struct xgbe_hw_if *hw_if = &pdata->hw_if;
struct xgbe_channel *channel; struct xgbe_channel *channel;
unsigned int dma_isr, dma_ch_isr; unsigned int dma_isr, dma_ch_isr;
...@@ -582,7 +582,7 @@ static void xgbe_isr_task(unsigned long data) ...@@ -582,7 +582,7 @@ static void xgbe_isr_task(unsigned long data)
/* If there is not a separate ECC irq, handle it here */ /* If there is not a separate ECC irq, handle it here */
if (pdata->vdata->ecc_support && (pdata->dev_irq == pdata->ecc_irq)) if (pdata->vdata->ecc_support && (pdata->dev_irq == pdata->ecc_irq))
xgbe_ecc_isr_task((unsigned long)pdata); xgbe_ecc_isr_task(&pdata->tasklet_ecc);
/* If there is not a separate I2C irq, handle it here */ /* If there is not a separate I2C irq, handle it here */
if (pdata->vdata->i2c_support && (pdata->dev_irq == pdata->i2c_irq)) if (pdata->vdata->i2c_support && (pdata->dev_irq == pdata->i2c_irq))
...@@ -607,7 +607,7 @@ static irqreturn_t xgbe_isr(int irq, void *data) ...@@ -607,7 +607,7 @@ static irqreturn_t xgbe_isr(int irq, void *data)
if (pdata->isr_as_tasklet) if (pdata->isr_as_tasklet)
tasklet_schedule(&pdata->tasklet_dev); tasklet_schedule(&pdata->tasklet_dev);
else else
xgbe_isr_task((unsigned long)pdata); xgbe_isr_task(&pdata->tasklet_dev);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
...@@ -991,9 +991,8 @@ static int xgbe_request_irqs(struct xgbe_prv_data *pdata) ...@@ -991,9 +991,8 @@ static int xgbe_request_irqs(struct xgbe_prv_data *pdata)
unsigned int i; unsigned int i;
int ret; int ret;
tasklet_init(&pdata->tasklet_dev, xgbe_isr_task, (unsigned long)pdata); tasklet_setup(&pdata->tasklet_dev, xgbe_isr_task);
tasklet_init(&pdata->tasklet_ecc, xgbe_ecc_isr_task, tasklet_setup(&pdata->tasklet_ecc, xgbe_ecc_isr_task);
(unsigned long)pdata);
ret = devm_request_irq(pdata->dev, pdata->dev_irq, xgbe_isr, 0, ret = devm_request_irq(pdata->dev, pdata->dev_irq, xgbe_isr, 0,
netdev_name(netdev), pdata); netdev_name(netdev), pdata);
......
...@@ -274,9 +274,9 @@ static void xgbe_i2c_clear_isr_interrupts(struct xgbe_prv_data *pdata, ...@@ -274,9 +274,9 @@ static void xgbe_i2c_clear_isr_interrupts(struct xgbe_prv_data *pdata,
XI2C_IOREAD(pdata, IC_CLR_STOP_DET); XI2C_IOREAD(pdata, IC_CLR_STOP_DET);
} }
static void xgbe_i2c_isr_task(unsigned long data) static void xgbe_i2c_isr_task(struct tasklet_struct *t)
{ {
struct xgbe_prv_data *pdata = (struct xgbe_prv_data *)data; struct xgbe_prv_data *pdata = from_tasklet(pdata, t, tasklet_i2c);
struct xgbe_i2c_op_state *state = &pdata->i2c.op_state; struct xgbe_i2c_op_state *state = &pdata->i2c.op_state;
unsigned int isr; unsigned int isr;
...@@ -324,7 +324,7 @@ static irqreturn_t xgbe_i2c_isr(int irq, void *data) ...@@ -324,7 +324,7 @@ static irqreturn_t xgbe_i2c_isr(int irq, void *data)
if (pdata->isr_as_tasklet) if (pdata->isr_as_tasklet)
tasklet_schedule(&pdata->tasklet_i2c); tasklet_schedule(&pdata->tasklet_i2c);
else else
xgbe_i2c_isr_task((unsigned long)pdata); xgbe_i2c_isr_task(&pdata->tasklet_i2c);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
...@@ -369,7 +369,7 @@ static void xgbe_i2c_set_target(struct xgbe_prv_data *pdata, unsigned int addr) ...@@ -369,7 +369,7 @@ static void xgbe_i2c_set_target(struct xgbe_prv_data *pdata, unsigned int addr)
static irqreturn_t xgbe_i2c_combined_isr(struct xgbe_prv_data *pdata) static irqreturn_t xgbe_i2c_combined_isr(struct xgbe_prv_data *pdata)
{ {
xgbe_i2c_isr_task((unsigned long)pdata); xgbe_i2c_isr_task(&pdata->tasklet_i2c);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
...@@ -462,8 +462,7 @@ static int xgbe_i2c_start(struct xgbe_prv_data *pdata) ...@@ -462,8 +462,7 @@ static int xgbe_i2c_start(struct xgbe_prv_data *pdata)
/* If we have a separate I2C irq, enable it */ /* If we have a separate I2C irq, enable it */
if (pdata->dev_irq != pdata->i2c_irq) { if (pdata->dev_irq != pdata->i2c_irq) {
tasklet_init(&pdata->tasklet_i2c, xgbe_i2c_isr_task, tasklet_setup(&pdata->tasklet_i2c, xgbe_i2c_isr_task);
(unsigned long)pdata);
ret = devm_request_irq(pdata->dev, pdata->i2c_irq, ret = devm_request_irq(pdata->dev, pdata->i2c_irq,
xgbe_i2c_isr, 0, pdata->i2c_name, xgbe_i2c_isr, 0, pdata->i2c_name,
......
...@@ -688,9 +688,9 @@ static void xgbe_an73_isr(struct xgbe_prv_data *pdata) ...@@ -688,9 +688,9 @@ static void xgbe_an73_isr(struct xgbe_prv_data *pdata)
} }
} }
static void xgbe_an_isr_task(unsigned long data) static void xgbe_an_isr_task(struct tasklet_struct *t)
{ {
struct xgbe_prv_data *pdata = (struct xgbe_prv_data *)data; struct xgbe_prv_data *pdata = from_tasklet(pdata, t, tasklet_an);
netif_dbg(pdata, intr, pdata->netdev, "AN interrupt received\n"); netif_dbg(pdata, intr, pdata->netdev, "AN interrupt received\n");
...@@ -715,14 +715,14 @@ static irqreturn_t xgbe_an_isr(int irq, void *data) ...@@ -715,14 +715,14 @@ static irqreturn_t xgbe_an_isr(int irq, void *data)
if (pdata->isr_as_tasklet) if (pdata->isr_as_tasklet)
tasklet_schedule(&pdata->tasklet_an); tasklet_schedule(&pdata->tasklet_an);
else else
xgbe_an_isr_task((unsigned long)pdata); xgbe_an_isr_task(&pdata->tasklet_an);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
static irqreturn_t xgbe_an_combined_isr(struct xgbe_prv_data *pdata) static irqreturn_t xgbe_an_combined_isr(struct xgbe_prv_data *pdata)
{ {
xgbe_an_isr_task((unsigned long)pdata); xgbe_an_isr_task(&pdata->tasklet_an);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
...@@ -1414,8 +1414,7 @@ static int xgbe_phy_start(struct xgbe_prv_data *pdata) ...@@ -1414,8 +1414,7 @@ static int xgbe_phy_start(struct xgbe_prv_data *pdata)
/* If we have a separate AN irq, enable it */ /* If we have a separate AN irq, enable it */
if (pdata->dev_irq != pdata->an_irq) { if (pdata->dev_irq != pdata->an_irq) {
tasklet_init(&pdata->tasklet_an, xgbe_an_isr_task, tasklet_setup(&pdata->tasklet_an, xgbe_an_isr_task);
(unsigned long)pdata);
ret = devm_request_irq(pdata->dev, pdata->an_irq, ret = devm_request_irq(pdata->dev, pdata->an_irq,
xgbe_an_isr, 0, pdata->an_name, xgbe_an_isr, 0, pdata->an_name,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册