From patchwork Mon Aug 26 10:07:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13777595 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4732EC5321E for ; Mon, 26 Aug 2024 10:12:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=3WbdwJwMzGd487Jm58/6IPAFGaqbJVFIEVy/1bU3kBU=; b=dfHXYotU7cE8Zs7EhHFATaPkA8 /bBopiXcWVOJntBhjkND+oq5zX6rwE85NUBBiHJW5RmmlY+igFOocMIC2tY79dyaYJRc7d/3qk3bE ldufAoLav5kaXPQX5ekKe0DwR0zJrCUWRvz+qZDW9RGoJnGW0sQTk4hrF78MoIJy4gp7yFhej9ppY Os1YcSIjFHnO2nIfdhjcondylBi2uNRC+DF6+eNWmEhnKkUOCnlR4l03ML9nzdoe+yU5GEtf9rdCn 6YndsA+JH6YvrpeAgKGDzZSSgmFwf8Db3W7OcU158OBtqcKaZktWQ/suwu8NM+9RHiwk0DYLpcq29 dwtXfnkA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1siWi7-00000006rwk-3m1D; Mon, 26 Aug 2024 10:12:31 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1siWdV-00000006qgq-2FGw for linux-arm-kernel@bombadil.infradead.org; Mon, 26 Aug 2024 10:07:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Sender:Reply-To:Content-ID:Content-Description; bh=3WbdwJwMzGd487Jm58/6IPAFGaqbJVFIEVy/1bU3kBU=; b=i1TWez8dogPwPSq8l0KJeZg5iz jJHWaGmEyeArBjUbs10Ncx0xf15UXH+pgzuxL8Yo7TwIGYTyrvarWfd4MEzUqYBuyEzlKw3lK7Pn+ qyKMbKvjQJ0s9WYhTUL9jsDgIB8k3C/B7tfYkslxeT5MSBEXdBkqMgyfMA31yquMCk1O4U2DuQ4xZ uUATBkFh9CJos+sotyLTxC6TxUFB/9ZIOz0xuKDvcqRmXsf9t2sMqmJu+/oipZTAMOVbcr4GH5HNY idp4haEzauiFgUb5/S5HR1t+n+8y4uYwqoeFx4SqpezgCjKdU+VgfZGd8epCuzSvhTvminCwzvmJX VqhbpD+Q==; Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1siWdP-0000000Ad6i-2fdG for linux-arm-kernel@lists.infradead.org; Mon, 26 Aug 2024 10:07:44 +0000 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-42803adb420so5120245e9.2 for ; Mon, 26 Aug 2024 03:07:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1724666857; x=1725271657; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=3WbdwJwMzGd487Jm58/6IPAFGaqbJVFIEVy/1bU3kBU=; b=oZgjnaCpq5y+DdK+o79IOjlgjdBFaspfXJfQL6quKgV8kJkGIQ6HxGqiK9H1ZbTTGv pMZSEHvYndzCdydcjgqppyKgBnho9tAx5iyuM8MyBsE/epggMFaEvOUqQYjHby0ZtJ71 V2/METTZBBzLoXS6Wpu408Am8/ijpsg8+qAa1P8/b6z6Uek8L5BHfFBPxHqnmu/LeBxv C96EU4BtsJc6Bob30Cxfdaw+FDJieXWbKnngR7NH22pEtwBP1LGM90OaslKcv9BlibH7 fWcHPOdkXUCtubvE6NhqfibD7F3sLwaRN+I8JIxNq5T9HpTqL8WHOeSZC8e5TRAEqLc1 vgoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724666857; x=1725271657; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3WbdwJwMzGd487Jm58/6IPAFGaqbJVFIEVy/1bU3kBU=; b=NwZfrCUn5uJ/CaHzRUS2Be/6BnP03QT/Y3it+CFmIF+GEsHzAl3+DgMULEsEnkEP5p E/TLB2DasbTv+CVX2q5XrZvtRfaVKttLsc5xzg4qpBamh/elRuPlZ7G0Wb9L+vffgIHg CPWIaNdIa8mQ3XQPLQWpTCYSzwHtTRRCNkDA9/aVN+0CnsICyvNVEf+zuYakKbMNekIN sXI5t0Vl3woWft1GDkqA5zZEAr7FzSJJbpN3YeWgMKwSRwL+/OcZM7XQInfrrKQ4QPTR awfAzZwbcot+uN7CVJT/0+PVVk5KBRg52jOP5g3kP75l4vE3TbvxD/T6g+7Yr4jp7NsX X0+A== X-Forwarded-Encrypted: i=1; AJvYcCVkgAK2drwfO3PZK0kFhyB/Fh4MCmcyL/is/iFhagR7DIr5CnMY5PBhX5mAfSmaEbGoY6G+P/xPpqm5dP49t2T7@lists.infradead.org X-Gm-Message-State: AOJu0YwK2uE4w3SgsVWMkZc26XXdabxotLFxaGrqY62HDAp+e9FM7ZFs Ycz4Ha1sbVEqNqKiJahLlgdTvfynR6i6i9QvnBeqdDKO4Z8vh3C5CJbXsAYzoQ9PS39cj4DKB04 o X-Google-Smtp-Source: AGHT+IFklH3Ny9t7GPphcYtSHUeO9OqMZPPFfYRC9xfJkhjaSEMhKLJDJuN0g5pcthbBx7LS51ulDQ== X-Received: by 2002:a5d:648e:0:b0:373:6bf:9608 with SMTP id ffacd0b85a97d-37311843370mr3729073f8f.2.1724666856869; Mon, 26 Aug 2024 03:07:36 -0700 (PDT) Received: from [127.0.1.1] ([178.197.222.82]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37308110009sm10324821f8f.18.2024.08.26.03.07.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Aug 2024 03:07:36 -0700 (PDT) From: Krzysztof Kozlowski Date: Mon, 26 Aug 2024 12:07:19 +0200 Subject: [PATCH 03/11] phy: cadence: sierra: Simplify with scoped for each OF child loop MIME-Version: 1.0 Message-Id: <20240826-phy-of-node-scope-v1-3-5b4d82582644@linaro.org> References: <20240826-phy-of-node-scope-v1-0-5b4d82582644@linaro.org> In-Reply-To: <20240826-phy-of-node-scope-v1-0-5b4d82582644@linaro.org> To: Vinod Koul , Kishon Vijay Abraham I , Ray Jui , Scott Branden , Broadcom internal kernel review list , Chunfeng Yun , Matthias Brugger , AngeloGioacchino Del Regno Cc: linux-phy@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2013; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=jtNLroZp6oDWwv/KZ3xoT8RtBVpmgjpirqt/ibFxI8s=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBmzFPbbKpPHL6GdF5Qqk8rC/GGGrQ4Hh1ZvCtrZ cPY7A2jkAWJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZsxT2wAKCRDBN2bmhouD 15SfD/9OO/+x3tuIvYd/WbnMT1CUTEf/bF9MuCLRDZpGzwZ8G5dCifwH0FuB5yPntS+hAZlBHp3 uIrluv46zJ/Bwsu8eq55BNiIRX2jDecimSOcjXpQndqjiK0v11mZqrpzbFr0PFZcxC2LdszLC9j /1mXPHAhb7CRvCnzKAieTGIY0RA+XP2H0vmzYIQLoc4P7pX19VuxzJhn1pz3CAxAS5qu/iHf5EE 7MfJDnYLKjy48xxkuXs2K2x7jfQv1rBa400T84DoO34MI6A/CxhYEvclBvEVotu+W2zY6x+C+ek QcfKOYnaW1fgCgbA6BpD64ycS2PLcs0Sa+U9KCaaxGkMFF3wcsTeHQ8medG4dhIrzRPyKTMyPkt VluPLHFOHLDew0KlZGSnd2Q1ksOGy+/45S1Oco+2jKUJKyOaiVhsS21scCBagibIWtRLLGHlDid JUVnWiX9yv436GZxILEaeALTUJZbn7NOJUcZK/mcLgVLcaG46CZnZgF+iw7uv1WpwIAUqXkaUpM bnfiSwO5YAEdHESCbWUmxilRSIntxrgzfEhTmEipYjHtmtGNX7nO0ZtShMAiKmpIsqb1+g8nxXE Vl6HFgHWsh5qYz0LpYb7xlW7AmzeV+0LqjatoYQECv4pDCWf/rZiuC8oqhQw3mBeO4gq/qcGhbr 2ZWDAaRAwHdBApA== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240826_110739_845382_3C28FD9B X-CRM114-Status: GOOD ( 13.31 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Use scoped for_each_available_child_of_node_scoped() when iterating over device nodes to make code a bit simpler. Signed-off-by: Krzysztof Kozlowski --- drivers/phy/cadence/phy-cadence-sierra.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/phy/cadence/phy-cadence-sierra.c b/drivers/phy/cadence/phy-cadence-sierra.c index 3010c9f24136..aeec6eb6be23 100644 --- a/drivers/phy/cadence/phy-cadence-sierra.c +++ b/drivers/phy/cadence/phy-cadence-sierra.c @@ -1366,7 +1366,7 @@ static int cdns_sierra_phy_probe(struct platform_device *pdev) unsigned int id_value; int ret, node = 0; void __iomem *base; - struct device_node *dn = dev->of_node, *child; + struct device_node *dn = dev->of_node; if (of_get_child_count(dn) == 0) return -ENODEV; @@ -1438,7 +1438,7 @@ static int cdns_sierra_phy_probe(struct platform_device *pdev) sp->autoconf = of_property_read_bool(dn, "cdns,autoconf"); - for_each_available_child_of_node(dn, child) { + for_each_available_child_of_node_scoped(dn, child) { struct phy *gphy; if (!(of_node_name_eq(child, "phy") || @@ -1452,7 +1452,6 @@ static int cdns_sierra_phy_probe(struct platform_device *pdev) dev_err(dev, "failed to get reset %s\n", child->full_name); ret = PTR_ERR(sp->phys[node].lnk_rst); - of_node_put(child); goto put_control; } @@ -1461,7 +1460,6 @@ static int cdns_sierra_phy_probe(struct platform_device *pdev) if (ret) { dev_err(dev, "missing property in node %s\n", child->name); - of_node_put(child); reset_control_put(sp->phys[node].lnk_rst); goto put_control; } @@ -1475,7 +1473,6 @@ static int cdns_sierra_phy_probe(struct platform_device *pdev) gphy = devm_phy_create(dev, child, &noop_ops); if (IS_ERR(gphy)) { ret = PTR_ERR(gphy); - of_node_put(child); reset_control_put(sp->phys[node].lnk_rst); goto put_control; }