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: 13777599 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 4826CC54732 for ; Mon, 26 Aug 2024 10:14:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :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=Is+xr0im9+9Uk49mTPDcTniI7A9/BNGWdY4dgW1pCP8=; b=l0VCZcUSmm7ANd aXG/0vENe49Aq90Ih9r1iSSOmQL35UJ/jPmjj0wmfjmQ6qtdhjFDh4nnZ0IfAkzO44XjIISxEs33o FSOzkLrd1endBJyroXm0VJKNOF8xDkP72OAlwihxBhv2qCnsmORzuuFD141+pqbt5QDiUEqty3fYr pCZKVBAwXYOOadHoNBeFTbUkFWhIH9M3LI+YWyKK0gWcJ+AMNlPE2O0pQYjUZBfxdy7tbvl7QhoDE We8lFAVGEHGw8k+Uf4O6IrRoT859+VYseP4OUkxTxSH4xcvqwdCXTguKQFHpkd5SXtyA6eiFVw35/ loGCrj43bUDM0HbB/Lbw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1siWkQ-00000006sYs-3NTp; Mon, 26 Aug 2024 10:14:54 +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 1siWda-00000006qjN-3i4v for linux-phy@bombadil.infradead.org; Mon, 26 Aug 2024 10:07:51 +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-x32e.google.com ([2a00:1450:4864:20::32e]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1siWdV-0000000Ad9m-3AH5 for linux-phy@lists.infradead.org; Mon, 26 Aug 2024 10:07:48 +0000 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-4281ddd3ae8so1819075e9.2 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=F9/5PTE9pvqF/kAiG2brGrxrRgzMQtDAJ0SaOH+fxeCh07aGPo6eb1ofRYl5q/qWa5 tHzPTG25N1rigbN+esNI+Dyf+L6Q1sRxd1F6awR8PcMnsIfcx6g07L+b28PcWfGkWx7a bSCggJn2qNm2Mz+ax2/nP5ttW1vcqOwNbNVmwRUxNTcwdEgioO75XZ9hGkiu8abwILnR P3W9G75c460qrSq10MBUV5pvoONHjpQQc4NIB6dEXAwv5fPAGglZkJLt040jwRz6m4my a7n9fSkDayZ9lk4J6TH1wdx1Uz38HFtdBGM1Npos0Po+vQ6nex/4gsm5hriMLPUolkeK dMgg== X-Gm-Message-State: AOJu0Yx3ylDsgDum1b4bBxqkiY/IVhTcBYQhFtZp7F6qadqTD9MrD1sm 9HyKlRkBqNOT8famgTeeblUXa/CMIHa3LTtZunIcervbGQe6OHbUuF4obLrDNQc= 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_110746_042803_D192ABAB X-CRM114-Status: GOOD ( 12.93 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=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 = {