Re: [PATCH] mfd: twl6030-irq: Use of_device_get_match_data()

"Rosen Penev" <[email protected]>
Newsgroups org.kernel.vger.linux-omap,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On Sun May 17, 2026 at 10:46 PM PDT, Andreas Kemnade wrote:
> On Sun, 17 May 2026 21:15:58 -0700
> Rosen Penev <[email protected]> wrote:
>
>> Use of_device_get_match_data() to fetch the IRQ mapping table directly instead of open-coding an of_match_device() lookup.
>>
>> This also lets the driver drop the of_device.h include.
>>
>> Assisted-by: Codex:GPT-5.5
>> Signed-off-by: Rosen Penev <[email protected]>
>> ---
>>  drivers/mfd/twl6030-irq.c | 10 ++++------
>>  1 file changed, 4 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/mfd/twl6030-irq.c b/drivers/mfd/twl6030-irq.c
>> index 0ca00f618d4d..8831c81a1f90 100644
>> --- a/drivers/mfd/twl6030-irq.c
>> +++ b/drivers/mfd/twl6030-irq.c
>> @@ -27,7 +27,6 @@
>>  #include <linux/suspend.h>
>>  #include <linux/of.h>
>>  #include <linux/irqdomain.h>
>> -#include <linux/of_device.h>
>>
>>  #include "twl-core.h"
>>
>> @@ -293,10 +292,10 @@ int twl6030_init_irq(struct device *dev, int irq_num)
>>  	int			nr_irqs;
>>  	int			status;
>>  	u8			mask[3];
>> -	const struct of_device_id *of_id;
>> +	const int *irq_mapping_tbl;
>>
>> -	of_id = of_match_device(twl6030_of_match, dev);
>
> twl6030_of_match is used only here.
>
>> -	if (!of_id || !of_id->data) {
>> +	irq_mapping_tbl = of_device_get_match_data(dev);
>
> so how should of_device_get_match_data() know about it?
Ah looks like this is wrong.
>
> Regards,
> Andreas
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.