Commit 304843c7 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Jakub Kicinski

ptp_ocp: use device_find_any_child() instead of custom approach

We have already a helper to get the first child device, use it and
drop custom approach.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: default avatarVadim Fedorenko <vadfed@fb.com>
Link: https://lore.kernel.org/r/20220921141005.2443-1-andriy.shevchenko@linux.intel.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 05cd8238
...@@ -1311,12 +1311,6 @@ ptp_ocp_read_eeprom(struct ptp_ocp *bp) ...@@ -1311,12 +1311,6 @@ ptp_ocp_read_eeprom(struct ptp_ocp *bp)
goto out; goto out;
} }
static int
ptp_ocp_firstchild(struct device *dev, void *data)
{
return 1;
}
static struct device * static struct device *
ptp_ocp_find_flash(struct ptp_ocp *bp) ptp_ocp_find_flash(struct ptp_ocp *bp)
{ {
...@@ -1325,7 +1319,7 @@ ptp_ocp_find_flash(struct ptp_ocp *bp) ...@@ -1325,7 +1319,7 @@ ptp_ocp_find_flash(struct ptp_ocp *bp)
last = NULL; last = NULL;
dev = &bp->spi_flash->dev; 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))) if (!strcmp("mtd", dev_bus_name(dev)))
break; break;
put_device(last); put_device(last);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment