From patchwork Mon Aug 26 10:07:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13777610 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 CC149C5321E for ; Mon, 26 Aug 2024 10:15:00 +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=w76jNQAWt6bAp+W3zUZ22TllXAAFoaq8C3LjT25NtVg=; b=1aQJ2gvuVkN5SGYi/bDAvXyPrW 5nVBaEA0OetzGLvP0ctr7vNCPZqof323ZC2VFYdCZyS8TJ8uQ4KllZs5uSe2h/VTxaGlwIPJw+Iny BsclmdqTbzdzYCf1M0CjeLpdawpfGqVwozN24P9U9FssTWfyr/xbDq5OLvXFH17dFvrDmat7wuhYv tnPXKTsA9oEoei5bXLD2ra9N13glQDDW09r/twBDsg/hN/0/UgQh5Ncvy/Y8SRUg/fK75V5t26Qda Dusw2dfnwDT94xuol+gHa1KRuLNb4c+CdiAjsCIF5Ms0YwkYtJJbiWN5hR/G7pcCVIc0Tqupc43W3 ycNaPKNQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1siWkN-00000006sWI-3oLL; Mon, 26 Aug 2024 10:14:51 +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 1siWdX-00000006qhm-32Wb for linux-arm-kernel@bombadil.infradead.org; Mon, 26 Aug 2024 10:07:47 +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=w76jNQAWt6bAp+W3zUZ22TllXAAFoaq8C3LjT25NtVg=; b=U7y7PTR63llOE3O6J/EAnGiqVL M7q+PN/MBh9wOqa+hs6WqF0FPlFT0g1PSip6PDzpaTUje7dzCH6c3Z4PszmQ/LdBHI6DFk59gh5OD WwA9KTNpqHDUUB7f9LG7KY22pqtjle1zy/c3g3LKyO6/sGwjVb/1Win/Ru26aiqRzAbT3fw/Cr/uW 1CXfwQOGY27QzyhgZxE3O1kT+tMdgruGVPvxbuGUBQh+lenNbDDRfFnrJ62C+iCzprLGahjYM0Xsp 9soMet+tDV7Waiggc8Zbpbd1TCvd52WQhuPvlleoasFZwAX+rzHuasvgl+I0b0me2X2+vMkOeoOul zZvQzx6w==; Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1siWdU-0000000Ad9s-20FO for linux-arm-kernel@lists.infradead.org; Mon, 26 Aug 2024 10:07:46 +0000 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-42b964d7526so628865e9.1 for ; Mon, 26 Aug 2024 03:07:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1724666863; x=1725271663; 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=w76jNQAWt6bAp+W3zUZ22TllXAAFoaq8C3LjT25NtVg=; b=MmoYJxw5AEtQVRFNe61sLwWL9esePIYl8Dv/guf49TOXrKtT+/EFLBBqAUKMAFriWh M0iGWFeMWJTsZPbxmpOMUysKisqIvLgAbSeuDX1OfkyselV7gn5lsswuxzA2B6STNcVT R2GudTSpT8eHe1lau4uoT+7q/QQPnNGghW7sz59R/saAYchipPHraxcxf60fBMhkTDcZ gNbuXC/KAOsEP0TCRzCVsPv+R03PW4vec7voijxayzBfwZBTrRY8f/OcBnsE2JD5+OBD CsuuDojMd3DD78pLHklEukzwArVI3eKDX38kZqRx0oweQrA5NREvR1cj/SWH8ur9KDi1 31/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724666863; x=1725271663; 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=w76jNQAWt6bAp+W3zUZ22TllXAAFoaq8C3LjT25NtVg=; b=MURJPfRB3mTSeyQNL4EfFhuZzsJbrAFG/BCqk8RAsoqWISKPXE3WU3xUVsWA6uqsAt sir5id4XjdGxB32k9G4Gll5C4Lvawe2QfajUIVBAcpFg4aXHYdfu1XAcV4TnrEeLc+wJ 3DumP0hWneGuf6kpTpnysZjHYvkGFNzLqdq9wMlj+cJqRw/6i+2cu7OJGOZtj/nZtf/7 5HfveNJLrqg7Jjg+BXGwzx/9T/kOXiLBMkcShM7rOcB0CB7AtgqDLoTVmlCMxaoKQ1Kh o6w63ykRX86QXZSKIAEQfpV8svcFuy9cMRrAma6K/izPro5nicXmVmmiFkpijj1aJ2Dh 54OA== X-Forwarded-Encrypted: i=1; AJvYcCWoQWaRV9ijv9qkdmuH05Lp3H/V1OcYdG+NELM2g74xzZ4Y81Y0FcgYjHgmB9NDGIN3DuAO/Q9lnYv99AFTYey/@lists.infradead.org X-Gm-Message-State: AOJu0YxpSkqNuNR7ask+kUGuaFg34tgM5DwPArweY8CFJYyIy6XKCZ76 6RGEWlAWg+sjkNeciju3A+2vUHW+cf0waVspigGM0VQapy56/rdhjPOsZIzDTwJmhBXMEL2HUn7 w X-Google-Smtp-Source: AGHT+IExT3kmRSceNRiJcXglO6EQr+JgRlwbktOceZAKBgocM3t4FdK6T71lQ8U1bTjnR+v/YdTdjA== X-Received: by 2002:a05:600c:1d22:b0:426:6fc0:5910 with SMTP id 5b1f17b1804b1-42acc8d4dabmr44531595e9.1.1724666862755; Mon, 26 Aug 2024 03:07:42 -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.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Aug 2024 03:07:42 -0700 (PDT) From: Krzysztof Kozlowski Date: Mon, 26 Aug 2024 12:07:23 +0200 Subject: [PATCH 07/11] phy: qcom: qmp-pcie-msm8996: Simplify with scoped for each OF child loop MIME-Version: 1.0 Message-Id: <20240826-phy-of-node-scope-v1-7-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=1922; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=XFJ5tns8gjfvYAtdDyTfcLoPh02DwDwXoBQWVHMfwN4=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBmzFPe01E0Dq3KWujpfT2EVykCertsjntcsXBD7 +xUsNUHtVaJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZsxT3gAKCRDBN2bmhouD 14N3D/47LpfmUaVHVAo6X4RPv0WAxp15k+koHvm3j2dUhTy7ZzV4EXYQECCOfFGsB+CPzxwJwc5 Lg5d7XwJxs9h5sfcDWf5rvgrpSoPqbgPEgMt3ofDnhmXcpelT+lJwgZ9DxZdGMx46xMNr0PIA63 1RHnEPF5iJQlH1zjQVUaiUtIoq9H5DtH3i3uF2msnwsgYRl/r11LxSlaBb37HgmubTH0EYr/3aV UyG65tricVuY4f7q9XjgSI86CCCoPjiclzQoYKo2Uwrw6e8/kbt6F2TfGwyadrvLyuWdwca9UhY NwnzS5Dfc+jtMIm1MG9dX+2Xog9uutXkTRBVyN/JAPUw4COYFxLwvoGdRNFtaK57V96PZF8TduH jB74iPXTm5PWTrZQlbhZlAuVbYzjVWL8F6cI62QbCjiJVaZXzJyHlVTCDKTL4a+qKhtQitydsGi YymvzTC0L9jX7NsoATfnvbDN5A04ldqhv7gyRHIghP4YZjWk5FGQU4KZC7j3Trdm2SH6aCR6T7G jIww5t/cBdwRPzapjcCNHE89Qks4EXKfW8NXS5TysLeSU0okvPw3A9eqJH/YyBqLPBWkmEu06zw gciV7L+UwHo++g8M73hfXlCa8sLYeYOySlvoUr+GWhJoZ1IHIl1LMpwU8WGjxFU02xUhUganhfm 6E0aoiBNZ6ogpTw== 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_110744_900379_BF8EF6E1 X-CRM114-Status: GOOD ( 14.23 ) 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 Reviewed-by: Dmitry Baryshkov --- drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c b/drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c index 5f89e3a3e54f..a7c65cfe31df 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c @@ -725,7 +725,6 @@ static int qmp_pcie_msm8996_probe(struct platform_device *pdev) { struct qcom_qmp *qmp; struct device *dev = &pdev->dev; - struct device_node *child; struct phy_provider *phy_provider; void __iomem *serdes; const struct qmp_phy_cfg *cfg = NULL; @@ -773,13 +772,13 @@ static int qmp_pcie_msm8996_probe(struct platform_device *pdev) return -ENOMEM; id = 0; - for_each_available_child_of_node(dev->of_node, child) { + for_each_available_child_of_node_scoped(dev->of_node, child) { /* Create per-lane phy */ ret = qmp_pcie_msm8996_create(dev, child, id, serdes, cfg); if (ret) { dev_err(dev, "failed to create lane%d phy, %d\n", id, ret); - goto err_node_put; + return ret; } /* @@ -790,7 +789,7 @@ static int qmp_pcie_msm8996_probe(struct platform_device *pdev) if (ret) { dev_err(qmp->dev, "failed to register pipe clock source\n"); - goto err_node_put; + return ret; } id++; @@ -799,10 +798,6 @@ static int qmp_pcie_msm8996_probe(struct platform_device *pdev) phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate); return PTR_ERR_OR_ZERO(phy_provider); - -err_node_put: - of_node_put(child); - return ret; } static struct platform_driver qmp_pcie_msm8996_driver = {