public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mfd: take OF node reference for MFD cell platform device
@ 2022-09-17  9:41 Sebastian Urban
  2022-09-20  9:25 ` Lee Jones
  0 siblings, 1 reply; 3+ messages in thread
From: Sebastian Urban @ 2022-09-17  9:41 UTC (permalink / raw)
  Cc: Sebastian Urban, Lee Jones, linux-kernel

Properly increase OF node reference count when assigning it to a
platform device created for an MFD cell.

Signed-off-by: Sebastian Urban <surban@surban.net>
---
 drivers/mfd/mfd-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c
index 16d1861e9682..8e57f67719cf 100644
--- a/drivers/mfd/mfd-core.c
+++ b/drivers/mfd/mfd-core.c
@@ -161,7 +161,7 @@ static int mfd_match_of_node_to_dev(struct platform_device *pdev,
 	of_entry->np = np;
 	list_add_tail(&of_entry->list, &mfd_of_node_list);
 
-	pdev->dev.of_node = np;
+	pdev->dev.of_node = of_node_get(np);
 	pdev->dev.fwnode = &np->fwnode;
 #endif
 	return 0;
-- 
2.34.1


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

* Re: [PATCH] mfd: take OF node reference for MFD cell platform device
  2022-09-17  9:41 [PATCH] mfd: take OF node reference for MFD cell platform device Sebastian Urban
@ 2022-09-20  9:25 ` Lee Jones
  2022-10-18  9:32   ` Lee Jones
  0 siblings, 1 reply; 3+ messages in thread
From: Lee Jones @ 2022-09-20  9:25 UTC (permalink / raw)
  To: Sebastian Urban; +Cc: linux-kernel

On Sat, 17 Sep 2022, Sebastian Urban wrote:

> Properly increase OF node reference count when assigning it to a
> platform device created for an MFD cell.
> 
> Signed-off-by: Sebastian Urban <surban@surban.net>
> ---
>  drivers/mfd/mfd-core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c
> index 16d1861e9682..8e57f67719cf 100644
> --- a/drivers/mfd/mfd-core.c
> +++ b/drivers/mfd/mfd-core.c
> @@ -161,7 +161,7 @@ static int mfd_match_of_node_to_dev(struct platform_device *pdev,
>  	of_entry->np = np;
>  	list_add_tail(&of_entry->list, &mfd_of_node_list);
>  
> -	pdev->dev.of_node = np;
> +	pdev->dev.of_node = of_node_get(np);

Doesn't this cause an imbalance?

Or is there already a put somewhere?

>  	pdev->dev.fwnode = &np->fwnode;
>  #endif
>  	return 0;

-- 
Lee Jones [李琼斯]

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

* Re: [PATCH] mfd: take OF node reference for MFD cell platform device
  2022-09-20  9:25 ` Lee Jones
@ 2022-10-18  9:32   ` Lee Jones
  0 siblings, 0 replies; 3+ messages in thread
From: Lee Jones @ 2022-10-18  9:32 UTC (permalink / raw)
  To: Sebastian Urban; +Cc: linux-kernel

On Tue, 20 Sep 2022, Lee Jones wrote:

> On Sat, 17 Sep 2022, Sebastian Urban wrote:
> 
> > Properly increase OF node reference count when assigning it to a
> > platform device created for an MFD cell.
> > 
> > Signed-off-by: Sebastian Urban <surban@surban.net>
> > ---
> >  drivers/mfd/mfd-core.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c
> > index 16d1861e9682..8e57f67719cf 100644
> > --- a/drivers/mfd/mfd-core.c
> > +++ b/drivers/mfd/mfd-core.c
> > @@ -161,7 +161,7 @@ static int mfd_match_of_node_to_dev(struct platform_device *pdev,
> >  	of_entry->np = np;
> >  	list_add_tail(&of_entry->list, &mfd_of_node_list);
> >  
> > -	pdev->dev.of_node = np;
> > +	pdev->dev.of_node = of_node_get(np);
> 
> Doesn't this cause an imbalance?
> 
> Or is there already a put somewhere?

I can't accept this until you've answered my queries.

-- 
Lee Jones [李琼斯]

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

end of thread, other threads:[~2022-10-18  9:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-17  9:41 [PATCH] mfd: take OF node reference for MFD cell platform device Sebastian Urban
2022-09-20  9:25 ` Lee Jones
2022-10-18  9:32   ` Lee Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox