Skip to content

Commit 7a29fa0

Browse files
ujfalusilag-linaro
authored andcommitted
mfd: twl6030-irq: Revert to use of_match_device()
The core twl chip is probed via i2c and the dev->driver->of_match_table is NULL, causing the driver to fail to probe. This partially reverts: commit 1e0c866 ("mfd: Use device_get_match_data() in a bunch of drivers") Fixes: 1e0c866 ("mfd: Use device_get_match_data() in a bunch of drivers") Signed-off-by: Peter Ujfalusi <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Lee Jones <[email protected]>
1 parent db76374 commit 7a29fa0

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/mfd/twl6030-irq.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424
#include <linux/kthread.h>
2525
#include <linux/mfd/twl.h>
2626
#include <linux/platform_device.h>
27-
#include <linux/property.h>
2827
#include <linux/suspend.h>
2928
#include <linux/of.h>
3029
#include <linux/irqdomain.h>
30+
#include <linux/of_device.h>
3131

3232
#include "twl-core.h"
3333

@@ -368,10 +368,10 @@ int twl6030_init_irq(struct device *dev, int irq_num)
368368
int nr_irqs;
369369
int status;
370370
u8 mask[3];
371-
const int *irq_tbl;
371+
const struct of_device_id *of_id;
372372

373-
irq_tbl = device_get_match_data(dev);
374-
if (!irq_tbl) {
373+
of_id = of_match_device(twl6030_of_match, dev);
374+
if (!of_id || !of_id->data) {
375375
dev_err(dev, "Unknown TWL device model\n");
376376
return -EINVAL;
377377
}
@@ -409,7 +409,7 @@ int twl6030_init_irq(struct device *dev, int irq_num)
409409

410410
twl6030_irq->pm_nb.notifier_call = twl6030_irq_pm_notifier;
411411
atomic_set(&twl6030_irq->wakeirqs, 0);
412-
twl6030_irq->irq_mapping_tbl = irq_tbl;
412+
twl6030_irq->irq_mapping_tbl = of_id->data;
413413

414414
twl6030_irq->irq_domain =
415415
irq_domain_add_linear(node, nr_irqs,

0 commit comments

Comments
 (0)