linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mfd: twl6030-irq: Revert to use of_match_device()
@ 2023-10-29 11:48 Peter Ujfalusi
  2023-11-23 10:37 ` Lee Jones
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Peter Ujfalusi @ 2023-10-29 11:48 UTC (permalink / raw)
  To: tony, lee, robh; +Cc: wens, linux-omap, linux-kernel

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.

Fixes: 1e0c866887f4 ("mfd: Use device_get_match_data() in a bunch of drivers")
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>
---
 drivers/mfd/twl6030-irq.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/mfd/twl6030-irq.c b/drivers/mfd/twl6030-irq.c
index f9fce8408c2c..3c03681c124c 100644
--- a/drivers/mfd/twl6030-irq.c
+++ b/drivers/mfd/twl6030-irq.c
@@ -24,10 +24,10 @@
 #include <linux/kthread.h>
 #include <linux/mfd/twl.h>
 #include <linux/platform_device.h>
-#include <linux/property.h>
 #include <linux/suspend.h>
 #include <linux/of.h>
 #include <linux/irqdomain.h>
+#include <linux/of_device.h>
 
 #include "twl-core.h"
 
@@ -368,10 +368,10 @@ int twl6030_init_irq(struct device *dev, int irq_num)
 	int			nr_irqs;
 	int			status;
 	u8			mask[3];
-	const int		*irq_tbl;
+	const struct of_device_id *of_id;
 
-	irq_tbl = device_get_match_data(dev);
-	if (!irq_tbl) {
+	of_id = of_match_device(twl6030_of_match, dev);
+	if (!of_id || !of_id->data) {
 		dev_err(dev, "Unknown TWL device model\n");
 		return -EINVAL;
 	}
@@ -409,7 +409,7 @@ int twl6030_init_irq(struct device *dev, int irq_num)
 
 	twl6030_irq->pm_nb.notifier_call = twl6030_irq_pm_notifier;
 	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 =
 		irq_domain_add_linear(node, nr_irqs,
-- 
2.42.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] mfd: twl6030-irq: Revert to use of_match_device()
  2023-10-29 11:48 [PATCH] mfd: twl6030-irq: Revert to use of_match_device() Peter Ujfalusi
@ 2023-11-23 10:37 ` Lee Jones
  2023-11-23 10:41   ` Lee Jones
  2023-12-01 11:30 ` (subset) " Lee Jones
  2024-02-19  9:52 ` Andreas Schwab
  2 siblings, 1 reply; 9+ messages in thread
From: Lee Jones @ 2023-11-23 10:37 UTC (permalink / raw)
  To: Peter Ujfalusi; +Cc: tony, robh, wens, linux-omap, linux-kernel

On Sun, 29 Oct 2023, Peter Ujfalusi wrote:

> 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.
> 
> Fixes: 1e0c866887f4 ("mfd: Use device_get_match_data() in a bunch of drivers")
> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>
> ---
>  drivers/mfd/twl6030-irq.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/mfd/twl6030-irq.c b/drivers/mfd/twl6030-irq.c
> index f9fce8408c2c..3c03681c124c 100644
> --- a/drivers/mfd/twl6030-irq.c
> +++ b/drivers/mfd/twl6030-irq.c
> @@ -24,10 +24,10 @@
>  #include <linux/kthread.h>
>  #include <linux/mfd/twl.h>
>  #include <linux/platform_device.h>
> -#include <linux/property.h>
>  #include <linux/suspend.h>
>  #include <linux/of.h>
>  #include <linux/irqdomain.h>
> +#include <linux/of_device.h>
>  
>  #include "twl-core.h"
>  
> @@ -368,10 +368,10 @@ int twl6030_init_irq(struct device *dev, int irq_num)
>  	int			nr_irqs;
>  	int			status;
>  	u8			mask[3];
> -	const int		*irq_tbl;
> +	const struct of_device_id *of_id;
>  
> -	irq_tbl = device_get_match_data(dev);
> -	if (!irq_tbl) {
> +	of_id = of_match_device(twl6030_of_match, dev);

I think you just dropped support for ACPI.

Rob, care to follow-up?

> +	if (!of_id || !of_id->data) {
>  		dev_err(dev, "Unknown TWL device model\n");
>  		return -EINVAL;
>  	}
> @@ -409,7 +409,7 @@ int twl6030_init_irq(struct device *dev, int irq_num)
>  
>  	twl6030_irq->pm_nb.notifier_call = twl6030_irq_pm_notifier;
>  	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 =
>  		irq_domain_add_linear(node, nr_irqs,
> -- 
> 2.42.0
> 

-- 
Lee Jones [李琼斯]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] mfd: twl6030-irq: Revert to use of_match_device()
  2023-11-23 10:37 ` Lee Jones
@ 2023-11-23 10:41   ` Lee Jones
  2023-11-23 15:40     ` Péter Ujfalusi
  0 siblings, 1 reply; 9+ messages in thread
From: Lee Jones @ 2023-11-23 10:41 UTC (permalink / raw)
  To: Peter Ujfalusi; +Cc: tony, robh, wens, linux-omap, linux-kernel

On Thu, 23 Nov 2023, Lee Jones wrote:

> On Sun, 29 Oct 2023, Peter Ujfalusi wrote:
> 
> > 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.
> > 
> > Fixes: 1e0c866887f4 ("mfd: Use device_get_match_data() in a bunch of drivers")
> > Signed-off-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>
> > ---
> >  drivers/mfd/twl6030-irq.c | 10 +++++-----
> >  1 file changed, 5 insertions(+), 5 deletions(-)
> > 
> > diff --git a/drivers/mfd/twl6030-irq.c b/drivers/mfd/twl6030-irq.c
> > index f9fce8408c2c..3c03681c124c 100644
> > --- a/drivers/mfd/twl6030-irq.c
> > +++ b/drivers/mfd/twl6030-irq.c
> > @@ -24,10 +24,10 @@
> >  #include <linux/kthread.h>
> >  #include <linux/mfd/twl.h>
> >  #include <linux/platform_device.h>
> > -#include <linux/property.h>
> >  #include <linux/suspend.h>
> >  #include <linux/of.h>
> >  #include <linux/irqdomain.h>
> > +#include <linux/of_device.h>
> >  
> >  #include "twl-core.h"
> >  
> > @@ -368,10 +368,10 @@ int twl6030_init_irq(struct device *dev, int irq_num)
> >  	int			nr_irqs;
> >  	int			status;
> >  	u8			mask[3];
> > -	const int		*irq_tbl;
> > +	const struct of_device_id *of_id;
> >  
> > -	irq_tbl = device_get_match_data(dev);
> > -	if (!irq_tbl) {
> > +	of_id = of_match_device(twl6030_of_match, dev);
> 
> I think you just dropped support for ACPI.

Ah, scrap that.  I was looking at the wrong part of 1e0c866887f4.

So what about the other drivers changed in the aforementioned commit?

Ideally we'd have a call that covers all of the various probing APIs.

> Rob, care to follow-up?

I'd still like Rob to comment.

-- 
Lee Jones [李琼斯]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] mfd: twl6030-irq: Revert to use of_match_device()
  2023-11-23 10:41   ` Lee Jones
@ 2023-11-23 15:40     ` Péter Ujfalusi
  2023-11-30 14:05       ` Lee Jones
  0 siblings, 1 reply; 9+ messages in thread
From: Péter Ujfalusi @ 2023-11-23 15:40 UTC (permalink / raw)
  To: Lee Jones; +Cc: tony, robh, wens, linux-omap, linux-kernel



On 23/11/2023 12:41, Lee Jones wrote:
>>> @@ -368,10 +368,10 @@ int twl6030_init_irq(struct device *dev, int irq_num)
>>>  	int			nr_irqs;
>>>  	int			status;
>>>  	u8			mask[3];
>>> -	const int		*irq_tbl;
>>> +	const struct of_device_id *of_id;
>>>  
>>> -	irq_tbl = device_get_match_data(dev);
>>> -	if (!irq_tbl) {
>>> +	of_id = of_match_device(twl6030_of_match, dev);
>>
>> I think you just dropped support for ACPI.
> 
> Ah, scrap that.  I was looking at the wrong part of 1e0c866887f4.
> 
> So what about the other drivers changed in the aforementioned commit?

Looking back at it again, I think only this patch is needed.
This is not a real driver, it is using the twl core's device.
The twl6030 is for sure broken, let me reply to the twl4030-power in a sec.

> Ideally we'd have a call that covers all of the various probing APIs.
> 
>> Rob, care to follow-up?
> 
> I'd still like Rob to comment.
> 

-- 
Péter

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] mfd: twl6030-irq: Revert to use of_match_device()
  2023-11-23 15:40     ` Péter Ujfalusi
@ 2023-11-30 14:05       ` Lee Jones
  0 siblings, 0 replies; 9+ messages in thread
From: Lee Jones @ 2023-11-30 14:05 UTC (permalink / raw)
  To: Péter Ujfalusi; +Cc: tony, robh, wens, linux-omap, linux-kernel

On Thu, 23 Nov 2023, Péter Ujfalusi wrote:

> 
> 
> On 23/11/2023 12:41, Lee Jones wrote:
> >>> @@ -368,10 +368,10 @@ int twl6030_init_irq(struct device *dev, int irq_num)
> >>>  	int			nr_irqs;
> >>>  	int			status;
> >>>  	u8			mask[3];
> >>> -	const int		*irq_tbl;
> >>> +	const struct of_device_id *of_id;
> >>>  
> >>> -	irq_tbl = device_get_match_data(dev);
> >>> -	if (!irq_tbl) {
> >>> +	of_id = of_match_device(twl6030_of_match, dev);
> >>
> >> I think you just dropped support for ACPI.
> > 
> > Ah, scrap that.  I was looking at the wrong part of 1e0c866887f4.
> > 
> > So what about the other drivers changed in the aforementioned commit?
> 
> Looking back at it again, I think only this patch is needed.
> This is not a real driver, it is using the twl core's device.
> The twl6030 is for sure broken, let me reply to the twl4030-power in a sec.
> 
> > Ideally we'd have a call that covers all of the various probing APIs.
> > 
> >> Rob, care to follow-up?

Rob, last chance to state your case before I apply it.

-- 
Lee Jones [李琼斯]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: (subset) [PATCH] mfd: twl6030-irq: Revert to use of_match_device()
  2023-10-29 11:48 [PATCH] mfd: twl6030-irq: Revert to use of_match_device() Peter Ujfalusi
  2023-11-23 10:37 ` Lee Jones
@ 2023-12-01 11:30 ` Lee Jones
  2024-02-19  9:52 ` Andreas Schwab
  2 siblings, 0 replies; 9+ messages in thread
From: Lee Jones @ 2023-12-01 11:30 UTC (permalink / raw)
  To: tony, lee, robh, Peter Ujfalusi; +Cc: wens, linux-omap, linux-kernel

On Sun, 29 Oct 2023 13:48:43 +0200, Peter Ujfalusi wrote:
> 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.
> 
> 

Applied, thanks!

[1/1] mfd: twl6030-irq: Revert to use of_match_device()
      commit: 6caa120c47c6f8ccb94c4a1d47e44c17de04057a

--
Lee Jones [李琼斯]


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] mfd: twl6030-irq: Revert to use of_match_device()
  2023-10-29 11:48 [PATCH] mfd: twl6030-irq: Revert to use of_match_device() Peter Ujfalusi
  2023-11-23 10:37 ` Lee Jones
  2023-12-01 11:30 ` (subset) " Lee Jones
@ 2024-02-19  9:52 ` Andreas Schwab
  2024-02-19 14:33   ` Lee Jones
  2 siblings, 1 reply; 9+ messages in thread
From: Andreas Schwab @ 2024-02-19  9:52 UTC (permalink / raw)
  To: Peter Ujfalusi; +Cc: tony, lee, robh, wens, linux-omap, linux-kernel, stable

On Okt 29 2023, Peter Ujfalusi wrote:

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

That commit id does not exist, which is why it hasn't been picked up by
stable.  The correct commit id is 830fafce06e6f.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] mfd: twl6030-irq: Revert to use of_match_device()
  2024-02-19  9:52 ` Andreas Schwab
@ 2024-02-19 14:33   ` Lee Jones
  2024-02-26 11:36     ` Tony Lindgren
  0 siblings, 1 reply; 9+ messages in thread
From: Lee Jones @ 2024-02-19 14:33 UTC (permalink / raw)
  To: Andreas Schwab
  Cc: Peter Ujfalusi, tony, robh, wens, linux-omap, linux-kernel, stable

On Mon, 19 Feb 2024, Andreas Schwab wrote:

> On Okt 29 2023, Peter Ujfalusi wrote:
> 
> > 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.
> >
> > Fixes: 1e0c866887f4 ("mfd: Use device_get_match_data() in a bunch of drivers")
> 
> That commit id does not exist, which is why it hasn't been picked up by
> stable.  The correct commit id is 830fafce06e6f.

It hasn't been picked by Stable because no one sent it to Stable. :)

-- 
Lee Jones [李琼斯]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] mfd: twl6030-irq: Revert to use of_match_device()
  2024-02-19 14:33   ` Lee Jones
@ 2024-02-26 11:36     ` Tony Lindgren
  0 siblings, 0 replies; 9+ messages in thread
From: Tony Lindgren @ 2024-02-26 11:36 UTC (permalink / raw)
  To: Lee Jones
  Cc: Andreas Schwab, Peter Ujfalusi, robh, wens, linux-omap,
	linux-kernel, stable

* Lee Jones <lee@kernel.org> [240219 14:33]:
> On Mon, 19 Feb 2024, Andreas Schwab wrote:
> 
> > On Okt 29 2023, Peter Ujfalusi wrote:
> > 
> > > 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.
> > >
> > > Fixes: 1e0c866887f4 ("mfd: Use device_get_match_data() in a bunch of drivers")
> > 
> > That commit id does not exist, which is why it hasn't been picked up by
> > stable.  The correct commit id is 830fafce06e6f.
> 
> It hasn't been picked by Stable because no one sent it to Stable. :)

Andreas, can you please send an email asking stable to pick it up?

See Documentation/process/stable-kernel-rules.rst for details.

Regards,

Tony

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-02-26 11:36 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-29 11:48 [PATCH] mfd: twl6030-irq: Revert to use of_match_device() Peter Ujfalusi
2023-11-23 10:37 ` Lee Jones
2023-11-23 10:41   ` Lee Jones
2023-11-23 15:40     ` Péter Ujfalusi
2023-11-30 14:05       ` Lee Jones
2023-12-01 11:30 ` (subset) " Lee Jones
2024-02-19  9:52 ` Andreas Schwab
2024-02-19 14:33   ` Lee Jones
2024-02-26 11:36     ` Tony Lindgren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).