aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Shevchenko <[email protected]>2022-09-21 17:10:05 +0300
committerJakub Kicinski <[email protected]>2022-09-22 19:30:05 -0700
commit304843c7ac44be6af5e88756496e8ead01436ebe (patch)
tree4195d15fed5faa5954eb7244304639c14facb624
parent05cd823863fd32e9fcd5e8818a0a9070e54cfcc1 (diff)
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: Andy Shevchenko <[email protected]> Acked-by: Vadim Fedorenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
-rw-r--r--drivers/ptp/ptp_ocp.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/ptp/ptp_ocp.c b/drivers/ptp/ptp_ocp.c
index e59ea2173aac..d36c3f597f77 100644
--- a/drivers/ptp/ptp_ocp.c
+++ b/drivers/ptp/ptp_ocp.c
@@ -1311,12 +1311,6 @@ fail:
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);