* [PATCH] mfd: twl4030-power: Revert to use of_match_device()
@ 2023-10-29 11:49 Peter Ujfalusi
2023-11-23 10:39 ` Lee Jones
0 siblings, 1 reply; 3+ messages in thread
From: Peter Ujfalusi @ 2023-10-29 11:49 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/twl4030-power.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/mfd/twl4030-power.c b/drivers/mfd/twl4030-power.c
index 1595e9c76132..e35b0f788c50 100644
--- a/drivers/mfd/twl4030-power.c
+++ b/drivers/mfd/twl4030-power.c
@@ -27,8 +27,8 @@
#include <linux/pm.h>
#include <linux/mfd/twl.h>
#include <linux/platform_device.h>
-#include <linux/property.h>
#include <linux/of.h>
+#include <linux/of_device.h>
#include <asm/mach-types.h>
@@ -883,6 +883,7 @@ static int twl4030_power_probe(struct platform_device *pdev)
{
const struct twl4030_power_data *pdata = dev_get_platdata(&pdev->dev);
struct device_node *node = pdev->dev.of_node;
+ const struct of_device_id *match;
int err = 0;
int err2 = 0;
u8 val;
@@ -903,8 +904,10 @@ static int twl4030_power_probe(struct platform_device *pdev)
return err;
}
- if (node)
- pdata = device_get_match_data(&pdev->dev);
+ match = of_match_device(of_match_ptr(twl4030_power_of_match),
+ &pdev->dev);
+ if (match && match->data)
+ pdata = match->data;
if (pdata) {
err = twl4030_power_configure_scripts(pdata);
--
2.42.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] mfd: twl4030-power: Revert to use of_match_device()
2023-10-29 11:49 [PATCH] mfd: twl4030-power: Revert to use of_match_device() Peter Ujfalusi
@ 2023-11-23 10:39 ` Lee Jones
2023-11-23 15:42 ` Péter Ujfalusi
0 siblings, 1 reply; 3+ messages in thread
From: Lee Jones @ 2023-11-23 10:39 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/twl4030-power.c | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
Rob, does this work for you?
--
Lee Jones [李琼斯]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mfd: twl4030-power: Revert to use of_match_device()
2023-11-23 10:39 ` Lee Jones
@ 2023-11-23 15:42 ` Péter Ujfalusi
0 siblings, 0 replies; 3+ messages in thread
From: Péter Ujfalusi @ 2023-11-23 15:42 UTC (permalink / raw)
To: Lee Jones; +Cc: tony, robh, wens, linux-omap, linux-kernel
On 23/11/2023 12:39, 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/twl4030-power.c | 9 ++++++---
>> 1 file changed, 6 insertions(+), 3 deletions(-)
>
> Rob, does this work for you?
This is not needed, twl4030-power is a proper platform device, it should
have of_match_data.
I had a boot failure likely caused by something else and I thought this
might be part of the puzzle to get it working again.
Sorry for the confusion.
--
Péter
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-11-23 15:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-29 11:49 [PATCH] mfd: twl4030-power: Revert to use of_match_device() Peter Ujfalusi
2023-11-23 10:39 ` Lee Jones
2023-11-23 15:42 ` Péter Ujfalusi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox