netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/1] ptp_ocp: use device_find_any_child() instead of custom approach
@ 2022-09-21 14:10 Andy Shevchenko
  2022-09-21 20:52 ` Vadim Fedorenko
  2022-09-23  2:40 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 4+ messages in thread
From: Andy Shevchenko @ 2022-09-21 14:10 UTC (permalink / raw)
  To: Jonathan Lemon, netdev, linux-kernel
  Cc: Vadim Fedorenko, Richard Cochran, Andy Shevchenko

We have already a helper to get the first child device, use it and
drop custom approach.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/ptp/ptp_ocp.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/ptp/ptp_ocp.c b/drivers/ptp/ptp_ocp.c
index 83da36e69361..ebed0161879e 100644
--- a/drivers/ptp/ptp_ocp.c
+++ b/drivers/ptp/ptp_ocp.c
@@ -1311,12 +1311,6 @@ ptp_ocp_read_eeprom(struct ptp_ocp *bp)
 	goto out;
 }
 
-static int
-ptp_ocp_firstchild(struct device *dev, void *data)
-{
-	return 1;
-}
-
 static struct device *
 ptp_ocp_find_flash(struct ptp_ocp *bp)
 {
@@ -1325,7 +1319,7 @@ ptp_ocp_find_flash(struct ptp_ocp *bp)
 	last = NULL;
 	dev = &bp->spi_flash->dev;
 
-	while ((dev = device_find_child(dev, NULL, ptp_ocp_firstchild))) {
+	while ((dev = device_find_any_child(dev))) {
 		if (!strcmp("mtd", dev_bus_name(dev)))
 			break;
 		put_device(last);
-- 
2.35.1


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

* Re: [PATCH v1 1/1] ptp_ocp: use device_find_any_child() instead of custom approach
  2022-09-21 14:10 [PATCH v1 1/1] ptp_ocp: use device_find_any_child() instead of custom approach Andy Shevchenko
@ 2022-09-21 20:52 ` Vadim Fedorenko
  2022-09-22 10:14   ` Andy Shevchenko
  2022-09-23  2:40 ` patchwork-bot+netdevbpf
  1 sibling, 1 reply; 4+ messages in thread
From: Vadim Fedorenko @ 2022-09-21 20:52 UTC (permalink / raw)
  To: Andy Shevchenko, Jonathan Lemon, netdev, linux-kernel
  Cc: Vadim Fedorenko, Richard Cochran

On 21.09.2022 15:10, Andy Shevchenko wrote:
> We have already a helper to get the first child device, use it and
> drop custom approach.
> 

LGTM. This patch should go to net-next, I believe.

Acked-by: Vadim Fedorenko <vadfed@fb.com>

> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>   drivers/ptp/ptp_ocp.c | 8 +-------
>   1 file changed, 1 insertion(+), 7 deletions(-)
> 
> diff --git a/drivers/ptp/ptp_ocp.c b/drivers/ptp/ptp_ocp.c
> index 83da36e69361..ebed0161879e 100644
> --- a/drivers/ptp/ptp_ocp.c
> +++ b/drivers/ptp/ptp_ocp.c
> @@ -1311,12 +1311,6 @@ ptp_ocp_read_eeprom(struct ptp_ocp *bp)
>   	goto out;
>   }
>   
> -static int
> -ptp_ocp_firstchild(struct device *dev, void *data)
> -{
> -	return 1;
> -}
> -
>   static struct device *
>   ptp_ocp_find_flash(struct ptp_ocp *bp)
>   {
> @@ -1325,7 +1319,7 @@ ptp_ocp_find_flash(struct ptp_ocp *bp)
>   	last = NULL;
>   	dev = &bp->spi_flash->dev;
>   
> -	while ((dev = device_find_child(dev, NULL, ptp_ocp_firstchild))) {
> +	while ((dev = device_find_any_child(dev))) {
>   		if (!strcmp("mtd", dev_bus_name(dev)))
>   			break;
>   		put_device(last);


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

* Re: [PATCH v1 1/1] ptp_ocp: use device_find_any_child() instead of custom approach
  2022-09-21 20:52 ` Vadim Fedorenko
@ 2022-09-22 10:14   ` Andy Shevchenko
  0 siblings, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2022-09-22 10:14 UTC (permalink / raw)
  To: Vadim Fedorenko
  Cc: Jonathan Lemon, netdev, linux-kernel, Vadim Fedorenko,
	Richard Cochran

On Wed, Sep 21, 2022 at 09:52:15PM +0100, Vadim Fedorenko wrote:
> On 21.09.2022 15:10, Andy Shevchenko wrote:
> > We have already a helper to get the first child device, use it and
> > drop custom approach.
> 
> LGTM. This patch should go to net-next, I believe.

Yes, I forgot to add the 'net-next' to the Subject line.

> Acked-by: Vadim Fedorenko <vadfed@fb.com>

Thanks!

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH v1 1/1] ptp_ocp: use device_find_any_child() instead of custom approach
  2022-09-21 14:10 [PATCH v1 1/1] ptp_ocp: use device_find_any_child() instead of custom approach Andy Shevchenko
  2022-09-21 20:52 ` Vadim Fedorenko
@ 2022-09-23  2:40 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-09-23  2:40 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: jonathan.lemon, netdev, linux-kernel, vadfed, richardcochran

Hello:

This patch was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Wed, 21 Sep 2022 17:10:05 +0300 you wrote:
> We have already a helper to get the first child device, use it and
> drop custom approach.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/ptp/ptp_ocp.c | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)

Here is the summary with links:
  - [v1,1/1] ptp_ocp: use device_find_any_child() instead of custom approach
    https://git.kernel.org/netdev/net-next/c/304843c7ac44

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2022-09-23  2:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-21 14:10 [PATCH v1 1/1] ptp_ocp: use device_find_any_child() instead of custom approach Andy Shevchenko
2022-09-21 20:52 ` Vadim Fedorenko
2022-09-22 10:14   ` Andy Shevchenko
2022-09-23  2:40 ` patchwork-bot+netdevbpf

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).