Skip to content

Commit 8614419

Browse files
committed
mfd: da9052: Fix genirq abuse
Rather than using the pointer passed back by the regmap API (or complaining because that wasn't actually being set) the da9052 driver was having some fun and games peering through genirq and regmap internals. Fix the driver to use the API as expected. Signed-off-by: Mark Brown <[email protected]>
1 parent dd775ae commit 8614419

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

drivers/mfd/da9052-core.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -659,12 +659,11 @@ int __devinit da9052_device_init(struct da9052 *da9052, u8 chip_id)
659659
ret = regmap_add_irq_chip(da9052->regmap, da9052->chip_irq,
660660
IRQF_TRIGGER_LOW | IRQF_ONESHOT,
661661
da9052->irq_base, &da9052_regmap_irq_chip,
662-
NULL);
662+
&da9052->irq_data);
663663
if (ret < 0)
664664
goto regmap_err;
665665

666-
desc = irq_to_desc(da9052->chip_irq);
667-
da9052->irq_base = regmap_irq_chip_get_base(desc->action->dev_id);
666+
da9052->irq_base = regmap_irq_chip_get_base(da9052->irq_data);
668667

669668
ret = mfd_add_devices(da9052->dev, -1, da9052_subdev_info,
670669
ARRAY_SIZE(da9052_subdev_info), NULL, 0);
@@ -681,8 +680,7 @@ int __devinit da9052_device_init(struct da9052 *da9052, u8 chip_id)
681680

682681
void da9052_device_exit(struct da9052 *da9052)
683682
{
684-
regmap_del_irq_chip(da9052->chip_irq,
685-
irq_get_irq_data(da9052->irq_base)->chip_data);
683+
regmap_del_irq_chip(da9052->chip_irq, da9052->irq_data);
686684
mfd_remove_devices(da9052->dev);
687685
}
688686

include/linux/mfd/da9052/da9052.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ struct da9052 {
8080
struct regmap *regmap;
8181

8282
int irq_base;
83+
struct regmap_irq_chip_data *irq_data;
8384
u8 chip_id;
8485

8586
int chip_irq;

0 commit comments

Comments
 (0)