Re: [PATCH] mfd: da9052-core: Fix request_threaded_irq() parameter

From: Marek Vasut
Date: Thu Sep 27 2012 - 09:44:02 EST


Dear Fabio Estevam,

> From: Fabio Estevam <fabio.estevam@xxxxxxxxxxxxx>
>
> On a mx53qsb dt-kernel the da9052-core driver fails to probe:
>
> da9052 1-0048: DA9052 ADC IRQ failed ret=-22
>
> In request_threaded_irq() the first parameter is missing the
> da9052->irq_base.
>
> Fix it and avoid the error.
>
> Also define 'DA9052_IRQF' for improving readability.
>
> Signed-off-by: Fabio Estevam <fabio.estevam@xxxxxxxxxxxxx>

Reviewed-by: Marek Vasut <marex@xxxxxxx>

> ---
> drivers/mfd/da9052-core.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/mfd/da9052-core.c b/drivers/mfd/da9052-core.c
> index a0a62b2..a3450d2 100644
> --- a/drivers/mfd/da9052-core.c
> +++ b/drivers/mfd/da9052-core.c
> @@ -33,6 +33,7 @@
> #define DA9052_IRQ_MASK_POS_6 0x20
> #define DA9052_IRQ_MASK_POS_7 0x40
> #define DA9052_IRQ_MASK_POS_8 0x80
> +#define DA9052_IRQF (IRQF_TRIGGER_LOW | IRQF_ONESHOT)
>
> static bool da9052_reg_readable(struct device *dev, unsigned int reg)
> {
> @@ -788,16 +789,15 @@ int __devinit da9052_device_init(struct da9052
> *da9052, u8 chip_id) da9052->irq_base = pdata->irq_base;
>
> ret = regmap_add_irq_chip(da9052->regmap, da9052->chip_irq,
> - IRQF_TRIGGER_LOW | IRQF_ONESHOT,
> - da9052->irq_base, &da9052_regmap_irq_chip,
> - &da9052->irq_data);
> + DA9052_IRQF, da9052->irq_base,
> + &da9052_regmap_irq_chip, &da9052->irq_data);
> if (ret < 0)
> goto regmap_err;
>
> da9052->irq_base = regmap_irq_chip_get_base(da9052->irq_data);
>
> - ret = request_threaded_irq(DA9052_IRQ_ADC_EOM, NULL, da9052_auxadc_irq,
> - IRQF_TRIGGER_LOW | IRQF_ONESHOT,
> + ret = request_threaded_irq(da9052->irq_base + DA9052_IRQ_ADC_EOM, NULL,
> + da9052_auxadc_irq, DA9052_IRQF,
> "adc irq", da9052);
> if (ret != 0)
> dev_err(da9052->dev, "DA9052 ADC IRQ failed ret=%d\n", ret);

Best regards,
Marek Vasut
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/