[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241224-const_dfc_done-v5-5-6623037414d4@quicinc.com>
Date: Tue, 24 Dec 2024 21:05:04 +0800
From: Zijun Hu <zijun_hu@...oud.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Linus Walleij <linus.walleij@...aro.org>,
Bartosz Golaszewski <brgl@...ev.pl>,
Uwe Kleine-König <ukleinek@...nel.org>,
James Bottomley <James.Bottomley@...senPartnership.com>,
Thomas Weißschuh <thomas@...ch.de>,
Zijun Hu <zijun_hu@...oud.com>, linux-kernel@...r.kernel.org,
nvdimm@...ts.linux.dev, linux-sound@...r.kernel.org,
sparclinux@...r.kernel.org, linux-block@...r.kernel.org,
linux-cxl@...r.kernel.org, linux1394-devel@...ts.sourceforge.net,
arm-scmi@...r.kernel.org, linux-efi@...r.kernel.org,
linux-gpio@...r.kernel.org, dri-devel@...ts.freedesktop.org,
linux-mediatek@...ts.infradead.org, linux-hwmon@...r.kernel.org,
linux-media@...r.kernel.org, linux-pwm@...r.kernel.org,
linux-remoteproc@...r.kernel.org, linux-scsi@...r.kernel.org,
linux-usb@...r.kernel.org, linux-serial@...r.kernel.org,
netdev@...r.kernel.org, Zijun Hu <quic_zijuhu@...cinc.com>,
Jonathan Cameron <Jonathan.Cameron@...wei.com>
Subject: [PATCH v5 05/12] driver core: Simplify API
device_find_child_by_name() implementation
From: Zijun Hu <quic_zijuhu@...cinc.com>
Simplify device_find_child_by_name() implementation by both existing
API device_find_child() and device_match_name().
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@...wei.com>
Signed-off-by: Zijun Hu <quic_zijuhu@...cinc.com>
---
drivers/base/core.c | 13 +------------
1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/drivers/base/core.c b/drivers/base/core.c
index bc3b523a4a6366080c3c9fd190e54c7fd13c8ded..8116bc8dd6e9eba0653ca686a90c7008de9e2840 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -4110,18 +4110,7 @@ EXPORT_SYMBOL_GPL(device_find_child);
struct device *device_find_child_by_name(struct device *parent,
const char *name)
{
- struct klist_iter i;
- struct device *child;
-
- if (!parent)
- return NULL;
-
- klist_iter_init(&parent->p->klist_children, &i);
- while ((child = next_device(&i)))
- if (sysfs_streq(dev_name(child), name) && get_device(child))
- break;
- klist_iter_exit(&i);
- return child;
+ return device_find_child(parent, name, device_match_name);
}
EXPORT_SYMBOL_GPL(device_find_child_by_name);
--
2.34.1
Powered by blists - more mailing lists