Commit 7a29fa05 authored by Peter Ujfalusi's avatar Peter Ujfalusi Committed by Lee Jones

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 1e0c866887f4 ("mfd: Use device_get_match_data() in a bunch of drivers")

Fixes: 1e0c866887f4 ("mfd: Use device_get_match_data() in a bunch of drivers")
Signed-off-by: default avatarPeter Ujfalusi <peter.ujfalusi@gmail.com>
Link: https://lore.kernel.org/r/20231029114843.15553-1-peter.ujfalusi@gmail.comSigned-off-by: default avatarLee Jones <lee@kernel.org>
parent db763745
...@@ -24,10 +24,10 @@ ...@@ -24,10 +24,10 @@
#include <linux/kthread.h> #include <linux/kthread.h>
#include <linux/mfd/twl.h> #include <linux/mfd/twl.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/property.h>
#include <linux/suspend.h> #include <linux/suspend.h>
#include <linux/of.h> #include <linux/of.h>
#include <linux/irqdomain.h> #include <linux/irqdomain.h>
#include <linux/of_device.h>
#include "twl-core.h" #include "twl-core.h"
...@@ -368,10 +368,10 @@ int twl6030_init_irq(struct device *dev, int irq_num) ...@@ -368,10 +368,10 @@ int twl6030_init_irq(struct device *dev, int irq_num)
int nr_irqs; int nr_irqs;
int status; int status;
u8 mask[3]; u8 mask[3];
const int *irq_tbl; const struct of_device_id *of_id;
irq_tbl = device_get_match_data(dev); of_id = of_match_device(twl6030_of_match, dev);
if (!irq_tbl) { if (!of_id || !of_id->data) {
dev_err(dev, "Unknown TWL device model\n"); dev_err(dev, "Unknown TWL device model\n");
return -EINVAL; return -EINVAL;
} }
...@@ -409,7 +409,7 @@ int twl6030_init_irq(struct device *dev, int irq_num) ...@@ -409,7 +409,7 @@ int twl6030_init_irq(struct device *dev, int irq_num)
twl6030_irq->pm_nb.notifier_call = twl6030_irq_pm_notifier; twl6030_irq->pm_nb.notifier_call = twl6030_irq_pm_notifier;
atomic_set(&twl6030_irq->wakeirqs, 0); atomic_set(&twl6030_irq->wakeirqs, 0);
twl6030_irq->irq_mapping_tbl = irq_tbl; twl6030_irq->irq_mapping_tbl = of_id->data;
twl6030_irq->irq_domain = twl6030_irq->irq_domain =
irq_domain_add_linear(node, nr_irqs, irq_domain_add_linear(node, nr_irqs,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment