projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
05cd823
)
ptp_ocp: use device_find_any_child() instead of custom approach
author
Andy Shevchenko
<andriy.shevchenko@linux.intel.com>
Wed, 21 Sep 2022 14:10:05 +0000
(17:10 +0300)
committer
Jakub Kicinski
<kuba@kernel.org>
Fri, 23 Sep 2022 02:30:05 +0000
(19:30 -0700)
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>
drivers/ptp/ptp_ocp.c
patch
|
blob
|
history
diff --git
a/drivers/ptp/ptp_ocp.c
b/drivers/ptp/ptp_ocp.c
index
e59ea21
..
d36c3f5
100644
(file)
--- 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);