Skip to content

Commit

Permalink
ptp_ocp: use device_find_any_child() instead of custom approach
Browse files Browse the repository at this point in the history
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>
Acked-by: Vadim Fedorenko <vadfed@fb.com>
Link: https://lore.kernel.org/r/20220921141005.2443-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Andy Shevchenko authored and Jakub Kicinski committed Sep 23, 2022
1 parent 05cd823 commit 304843c
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions drivers/ptp/ptp_ocp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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);
Expand Down

0 comments on commit 304843c

Please sign in to comment.