lkml.org 
[lkml]   [2022]   [Sep]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v1 1/1] ptp_ocp: use device_find_any_child() instead of custom approach
From
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);

\
 
 \ /
  Last update: 2022-09-21 23:01    [W:0.038 / U:1.288 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site