diff mbox series

[v1,1/1] ptp_ocp: use device_find_any_child() instead of custom approach

Message ID 20220921141005.2443-1-andriy.shevchenko@linux.intel.com (mailing list archive)
State Accepted
Commit 304843c7ac44be6af5e88756496e8ead01436ebe
Delegated to: Netdev Maintainers
Headers show
Series [v1,1/1] ptp_ocp: use device_find_any_child() instead of custom approach | expand

Checks

Context Check Description
netdev/tree_selection success Guessed tree name to be net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers success CCed 4 of 4 maintainers
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 20 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Andy Shevchenko Sept. 21, 2022, 2:10 p.m. UTC
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(-)

Comments

Vadim Fedorenko Sept. 21, 2022, 8:52 p.m. UTC | #1
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);
Andy Shevchenko Sept. 22, 2022, 10:14 a.m. UTC | #2
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!
patchwork-bot+netdevbpf@kernel.org Sept. 23, 2022, 2:40 a.m. UTC | #3
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!
diff mbox series

Patch

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