Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Peter Ujfalusi <peter.ujfalusi@gmail.com>
Link: https://lore.kernel.org/r/20231029114843.15553-1-peter.ujfalusi@gmail.com
Signed-off-by: Lee Jones <lee@kernel.org>

authored by

Peter Ujfalusi and committed by
Lee Jones
7a29fa05 db763745

+5 -5
+5 -5
drivers/mfd/twl6030-irq.c
··· 24 24 #include <linux/kthread.h> 25 25 #include <linux/mfd/twl.h> 26 26 #include <linux/platform_device.h> 27 - #include <linux/property.h> 28 27 #include <linux/suspend.h> 29 28 #include <linux/of.h> 30 29 #include <linux/irqdomain.h> 30 + #include <linux/of_device.h> 31 31 32 32 #include "twl-core.h" 33 33 ··· 368 368 int nr_irqs; 369 369 int status; 370 370 u8 mask[3]; 371 - const int *irq_tbl; 371 + const struct of_device_id *of_id; 372 372 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) { 375 375 dev_err(dev, "Unknown TWL device model\n"); 376 376 return -EINVAL; 377 377 } ··· 409 409 410 410 twl6030_irq->pm_nb.notifier_call = twl6030_irq_pm_notifier; 411 411 atomic_set(&twl6030_irq->wakeirqs, 0); 412 - twl6030_irq->irq_mapping_tbl = irq_tbl; 412 + twl6030_irq->irq_mapping_tbl = of_id->data; 413 413 414 414 twl6030_irq->irq_domain = 415 415 irq_domain_add_linear(node, nr_irqs,