Message ID | 20241205-const_dfc_done-v3-5-1611f1486b5a@quicinc.com |
---|---|
State | New |
Headers | show
Return-Path: <SRS0=x5o/=S6=vger.kernel.org=sparclinux+bounces-2729-patchwork-incoming=ozlabs.org@ozlabs.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=icloud.com header.i=@icloud.com header.a=rsa-sha256 header.s=1a1hai header.b=IVuWGgnz; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=ozlabs.org (client-ip=2404:9400:2221:ea00::3; helo=mail.ozlabs.org; envelope-from=srs0=x5o/=s6=vger.kernel.org=sparclinux+bounces-2729-patchwork-incoming=ozlabs.org@ozlabs.org; receiver=patchwork.ozlabs.org) Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Y3Zcm552hz1xrC for <incoming@patchwork.ozlabs.org>; Thu, 5 Dec 2024 11:14:00 +1100 (AEDT) Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by gandalf.ozlabs.org (Postfix) with ESMTP id 4Y3Zch6dtWz4xg5 for <incoming@patchwork.ozlabs.org>; Thu, 5 Dec 2024 11:13:56 +1100 (AEDT) Received: by gandalf.ozlabs.org (Postfix) id 4Y3Zch6ZSZz4xg8; Thu, 5 Dec 2024 11:13:56 +1100 (AEDT) Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: gandalf.ozlabs.org; arc=pass smtp.remote-ip=139.178.88.99 arc.chain=subspace.kernel.org ARC-Seal: i=2; a=rsa-sha256; d=ozlabs.org; s=201707; t=1733357636; cv=pass; b=WsGEmboY0W9IVPcluqJV+N3Vo3v4uqlOkKtiKJXGtE64c0AyMRaB23/ZM6+n0Dqnip5pnTf4JwXDfpIpgYXaWrMo0JJ0mCqDFsnGZIBiQctMqdTIqhxpAfmbw0cxjxCcmF9tyDPa4aqWQYYJ4rF5ssc0dVZyw78DXGmSwopea2dATu4UXm4aducuJzA/xGZ7RWBp/redE2Oot58aqPKI9o3bpsBBKMhfL3lkHclHGhVCb7KniUMbn8+vtFka5rru+FTZGIxTNQkIRI9cKP8Ksk7s4xCd33KmOEQyysdpKZy8vG1IAVEN7WfoNqNOlK31pu/Cq7pA7Jk+Fwk/1Dji2Q== ARC-Message-Signature: i=2; a=rsa-sha256; d=ozlabs.org; s=201707; t=1733357636; c=relaxed/relaxed; bh=IkjKR7CpPDn98sYTBYYKWLyDknZN2jQuVV1iJBo+zv4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=v19+QZiEqFJA99si6rjYZbNpubztvwNRntJSnC9lnuaYkHYSQMZWpv5haJgp7h9ms/nL2vPPEJ314otTEW+dR8YCK5xUptSbhvmEEj4feK320/UPZty7gnxTW/5RaipbnmL/H6f+zGM81KzJOx2zZDh5bm9KxLf5KfBLVTSgqa61I8qK4eIZblMAbmKzuUzcb+R4jGxVH4tp+BdXq3sQF7l82TGCt0Hhxws72oCCiB0O3sL/V62c9BXo1jFRvXVJMTbEbB9tfezWlZJuuQplQin9WIaB/ydqfxVM9107bjYMh89kFj230/voGAu2+1cUEhXNdTmAfDAuF2V5HqMA8g== ARC-Authentication-Results: i=2; gandalf.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=icloud.com; dkim=pass (2048-bit key; unprotected) header.d=icloud.com header.i=@icloud.com header.a=rsa-sha256 header.s=1a1hai header.b=IVuWGgnz; dkim-atps=neutral; spf=pass (client-ip=139.178.88.99; helo=sv.mirrors.kernel.org; envelope-from=sparclinux+bounces-2729-patchwork-incoming=ozlabs.org@vger.kernel.org; receiver=ozlabs.org) smtp.mailfrom=vger.kernel.org Authentication-Results: gandalf.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=icloud.com Authentication-Results: gandalf.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=icloud.com header.i=@icloud.com header.a=rsa-sha256 header.s=1a1hai header.b=IVuWGgnz; dkim-atps=neutral Authentication-Results: gandalf.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=139.178.88.99; helo=sv.mirrors.kernel.org; envelope-from=sparclinux+bounces-2729-patchwork-incoming=ozlabs.org@vger.kernel.org; receiver=ozlabs.org) Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org [139.178.88.99]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by gandalf.ozlabs.org (Postfix) with ESMTPS id 4Y3Zcd4GJ1z4xg5 for <patchwork-incoming@ozlabs.org>; Thu, 5 Dec 2024 11:13:53 +1100 (AEDT) Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 4C2C52844FF for <patchwork-incoming@ozlabs.org>; Thu, 5 Dec 2024 00:13:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5384E187FE0; Thu, 5 Dec 2024 00:12:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=icloud.com header.i=@icloud.com header.b="IVuWGgnz" X-Original-To: sparclinux@vger.kernel.org Received: from pv50p00im-tydg10011801.me.com (pv50p00im-tydg10011801.me.com [17.58.6.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 608B715B980 for <sparclinux@vger.kernel.org>; Thu, 5 Dec 2024 00:12:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=17.58.6.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733357525; cv=none; b=oZbY9FrK6SDzM/RAEW6y/PAkF9wYWpvvoWlVgdGUoNKjBS6Vptn7Azf6iJwsT/pijzUKdXfZnH+YwJQR/a5cL11nJ4ax0vqUA2yubYRv/5OhCNSeRP7r6RTmaFzCShf18KsD+miNVD+CTRxEndX14aRvjt3Hgblvxfe8Iqx+l1k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733357525; c=relaxed/simple; bh=GADZmka4YuYm1DhxT8gvvi2TBpPC5izf+AdJngKx+l0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=TiHYxYz2alKjgy7fBUzzNq2x0D0Ivb3xGDQtY8lbUOs/WaHwq3slSDY1KoaHaCRkMD2m7QE6Mhj7rhfLWigh+rhy42ox9KQgvZ7vgrM/VroGqjbmf0XEUDGZvzw9zN5GUBMx5XTt6F3pckuVWG7T78JlMVab+vrV5kGlvh7V2ic= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=icloud.com; spf=pass smtp.mailfrom=icloud.com; dkim=pass (2048-bit key) header.d=icloud.com header.i=@icloud.com header.b=IVuWGgnz; arc=none smtp.client-ip=17.58.6.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=icloud.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=icloud.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=1a1hai; t=1733357522; bh=IkjKR7CpPDn98sYTBYYKWLyDknZN2jQuVV1iJBo+zv4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To: x-icloud-hme; b=IVuWGgnz7EZJQeECGBnttHxtoDGtsZ2uuQ/QCPHYTO74bhz2JeY/0NPUfzoPC39gF GLFBnXK4FWKcvVDw5l7YeSoS9Pz+KnQDkKmQihxDWYapsOpxgcX5qc4Vu7FUnt99r0 RyLOD9xXpfx0p/+2pqYPd/oqaaCySRZTkeWVfw+DfNW3D+ZJoEMsJ/KM87YuCoeO7T CQJlLhaJ+oIz1herHq0DUsQpE7prIiem6U1IazFdPyy0EuS9fO/VNKFY9zLfvbX1vC odWSZWoxV5wBEpzOQGE5dxelbt7yjAymHYCLHgVzNHveTkxA0puCW2IxmhGOPwrncX N8FMNSNM/Ecxg== Received: from [192.168.1.26] (pv50p00im-dlb-asmtp-mailmevip.me.com [17.56.9.10]) by pv50p00im-tydg10011801.me.com (Postfix) with ESMTPSA id 0FBE68002AE; Thu, 5 Dec 2024 00:11:50 +0000 (UTC) From: Zijun Hu <zijun_hu@icloud.com> Date: Thu, 05 Dec 2024 08:10:14 +0800 Subject: [PATCH v3 05/11] driver core: Simplify API device_find_child_by_name() implementation Precedence: bulk X-Mailing-List: sparclinux@vger.kernel.org List-Id: <sparclinux.vger.kernel.org> List-Subscribe: <mailto:sparclinux+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:sparclinux+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20241205-const_dfc_done-v3-5-1611f1486b5a@quicinc.com> References: <20241205-const_dfc_done-v3-0-1611f1486b5a@quicinc.com> In-Reply-To: <20241205-const_dfc_done-v3-0-1611f1486b5a@quicinc.com> To: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= <ukleinek@kernel.org>, James Bottomley <James.Bottomley@HansenPartnership.com>, =?utf-8?q?Thomas_?= =?utf-8?q?Wei=C3=9Fschuh?= <thomas@t-8ch.de>, Zijun Hu <zijun_hu@icloud.com>, linux-kernel@vger.kernel.org, nvdimm@lists.linux.dev, linux-sound@vger.kernel.org, sparclinux@vger.kernel.org, linux-block@vger.kernel.org, linux-cxl@vger.kernel.org, linux1394-devel@lists.sourceforge.net, arm-scmi@vger.kernel.org, linux-efi@vger.kernel.org, linux-gpio@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, linux-hwmon@vger.kernel.org, linux-media@vger.kernel.org, linux-pwm@vger.kernel.org, linux-remoteproc@vger.kernel.org, linux-scsi@vger.kernel.org, open-iscsi@googlegroups.com, linux-usb@vger.kernel.org, linux-serial@vger.kernel.org, netdev@vger.kernel.org, Zijun Hu <quic_zijuhu@quicinc.com> X-Mailer: b4 0.14.2 X-Proofpoint-ORIG-GUID: nR0Td9EIK3Obz30PFAIkB0fn5HoVn60t X-Proofpoint-GUID: nR0Td9EIK3Obz30PFAIkB0fn5HoVn60t X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2024-12-04_19,2024-12-04_02,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 malwarescore=0 clxscore=1015 phishscore=0 suspectscore=0 bulkscore=0 mlxscore=0 spamscore=0 mlxlogscore=826 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2308100000 definitions=main-2412040186 X-Apple-Remote-Links: v=1;h=KCk=;charset=UTF-8 X-Spam-Status: No, score=-3.4 required=5.0 tests=ARC_SIGNED,ARC_VALID, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DMARC_PASS, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=disabled version=4.0.0 X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on gandalf.ozlabs.org |
Series |
driver core: Constify API device_find_child()
|
expand
|
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);