mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
crypto: talitos - pass talitos_private to irq handlers
The irq handlers only need priv, which they can get from the dev_get_drvdata() they currently perform on the struct device passed as data. Pass priv directly as the irq handler data and drop the dev_get_drvdata() call, while deriving dev from priv->dev where still needed. Assisted-by: opencode:deepseek-v4-flash-free Signed-off-by: Rosen Penev <rosenp@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
b01c7923e7
commit
13b481b15e
|
|
@ -751,8 +751,7 @@ static void talitos_error(struct device *dev, u32 isr, u32 isr_lo)
|
|||
#define DEF_TALITOS1_INTERRUPT(name, ch_done_mask, ch_err_mask, tlet) \
|
||||
static irqreturn_t talitos1_interrupt_##name(int irq, void *data) \
|
||||
{ \
|
||||
struct device *dev = data; \
|
||||
struct talitos_private *priv = dev_get_drvdata(dev); \
|
||||
struct talitos_private *priv = data; \
|
||||
u32 isr, isr_lo; \
|
||||
unsigned long flags; \
|
||||
\
|
||||
|
|
@ -765,7 +764,7 @@ static irqreturn_t talitos1_interrupt_##name(int irq, void *data) \
|
|||
\
|
||||
if (unlikely(isr & ch_err_mask || isr_lo & TALITOS1_IMR_LO_INIT)) { \
|
||||
spin_unlock_irqrestore(&priv->reg_lock, flags); \
|
||||
talitos_error(dev, isr & ch_err_mask, isr_lo); \
|
||||
talitos_error(priv->dev, isr & ch_err_mask, isr_lo); \
|
||||
} \
|
||||
else { \
|
||||
if (likely(isr & ch_done_mask)) { \
|
||||
|
|
@ -786,8 +785,7 @@ DEF_TALITOS1_INTERRUPT(4ch, TALITOS1_ISR_4CHDONE, TALITOS1_ISR_4CHERR, 0)
|
|||
#define DEF_TALITOS2_INTERRUPT(name, ch_done_mask, ch_err_mask, tlet) \
|
||||
static irqreturn_t talitos2_interrupt_##name(int irq, void *data) \
|
||||
{ \
|
||||
struct device *dev = data; \
|
||||
struct talitos_private *priv = dev_get_drvdata(dev); \
|
||||
struct talitos_private *priv = data; \
|
||||
u32 isr, isr_lo; \
|
||||
unsigned long flags; \
|
||||
\
|
||||
|
|
@ -800,7 +798,7 @@ static irqreturn_t talitos2_interrupt_##name(int irq, void *data) \
|
|||
\
|
||||
if (unlikely(isr & ch_err_mask || isr_lo)) { \
|
||||
spin_unlock_irqrestore(&priv->reg_lock, flags); \
|
||||
talitos_error(dev, isr & ch_err_mask, isr_lo); \
|
||||
talitos_error(priv->dev, isr & ch_err_mask, isr_lo); \
|
||||
} \
|
||||
else { \
|
||||
if (likely(isr & ch_done_mask)) { \
|
||||
|
|
@ -3242,7 +3240,7 @@ static void talitos_remove(struct platform_device *ofdev)
|
|||
|
||||
for (i = 0; i < 2; i++)
|
||||
if (priv->irq[i] > 0)
|
||||
free_irq(priv->irq[i], dev);
|
||||
free_irq(priv->irq[i], priv);
|
||||
|
||||
tasklet_kill(&priv->done_task[0]);
|
||||
if (priv->irq[1] > 0)
|
||||
|
|
@ -3361,7 +3359,7 @@ static int talitos_probe_irq(struct platform_device *ofdev)
|
|||
|
||||
if (is_sec1) {
|
||||
err = request_irq(priv->irq[0], talitos1_interrupt_4ch, 0,
|
||||
dev_driver_string(dev), dev);
|
||||
dev_driver_string(dev), priv);
|
||||
goto primary_out;
|
||||
}
|
||||
|
||||
|
|
@ -3372,18 +3370,18 @@ static int talitos_probe_irq(struct platform_device *ofdev)
|
|||
/* get the primary irq line */
|
||||
if (priv->irq[1] < 0) {
|
||||
err = request_irq(priv->irq[0], talitos2_interrupt_4ch, 0,
|
||||
dev_driver_string(dev), dev);
|
||||
dev_driver_string(dev), priv);
|
||||
goto primary_out;
|
||||
}
|
||||
|
||||
err = request_irq(priv->irq[0], talitos2_interrupt_ch0_2, 0,
|
||||
dev_driver_string(dev), dev);
|
||||
dev_driver_string(dev), priv);
|
||||
if (err)
|
||||
goto primary_out;
|
||||
|
||||
/* get the secondary irq line */
|
||||
err = request_irq(priv->irq[1], talitos2_interrupt_ch1_3, 0,
|
||||
dev_driver_string(dev), dev);
|
||||
dev_driver_string(dev), priv);
|
||||
if (err) {
|
||||
dev_err(dev, "failed to request secondary irq\n");
|
||||
priv->irq[1] = 0;
|
||||
|
|
@ -3422,6 +3420,7 @@ static int talitos_probe(struct platform_device *ofdev)
|
|||
|
||||
dev_set_drvdata(dev, priv);
|
||||
|
||||
priv->dev = dev;
|
||||
priv->ofdev = ofdev;
|
||||
|
||||
spin_lock_init(&priv->reg_lock);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user