From patchwork Wed Aug 14 15:04:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13763630 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 73A3EC52D7B for ; Wed, 14 Aug 2024 15:07:30 +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=9KwtbTNhxK6QLwV2KuYR/1Wk3sxaWn7bUkVHDhGR+MM=; b=uLILc1jbbDnZNCcFANuJ5an1bU 93iWd1+sAVba4uKUP5ZZlF74UYxkpIyffshddThtxeWKdu0tts+LxwVNe7pLBvL5zugbB0JwVSb/A VQeegkEUOQcTji0vmvAEUTxTuATYTDoqdP60G2K5+VIrBNGvCRVYnen/lvuNjuCdBF0Oan5TeGFOv A/ovsOEpLV81qoH+tKZFwrDyo1ADH6X4nHmGWSaqwlinwZRSK41CGV3wKK6JyubEFP4px44Ts/a3s WQspcGoOUps94sRN+QRy0Ticl63RolnazOWYl0dxzsWLYZljne0nMjdUHdMhq76WY/2AvoGIsBxjp Jh0yOjDQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1seFak-00000007QQq-0ouv; Wed, 14 Aug 2024 15:07:14 +0000 Received: from mail-lf1-x135.google.com ([2a00:1450:4864:20::135]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1seFY4-00000007Pin-2rZp for linux-arm-kernel@lists.infradead.org; Wed, 14 Aug 2024 15:04:30 +0000 Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-530e062217eso8359150e87.1 for ; Wed, 14 Aug 2024 08:04:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723647867; x=1724252667; 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=9KwtbTNhxK6QLwV2KuYR/1Wk3sxaWn7bUkVHDhGR+MM=; b=C0VwtrAHNWhdynU97WdaWvotf3TrZTQWbFjEIx+d3rMwWAnVie1llp5KQH07jNBn6i aLy92w8BcrjnwnRbtOMq6kBR+hrcmf4AMdHwb/ayJUNlJaLHsXcqCsI7oiw/lwBlgLmV Fez7a8FEUNbpst7B84Fmf1E0WkHaPRTTo88H2DmvjaxZWWUZebdJvvWz4CK3pSVD4wjg feEuZI7n9G7kJis5VmRKUe1UTaZe8EXyMe87DXER0/bWXotMGAUD/iHcy6P1hMqzYlxq M82nfzpx+I4ZBv6BsTNCKjDnGGsBCyOQzahpR2Ghquj9clGjWXwLGnOHmwwLFm8Ezptf XHVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723647867; x=1724252667; 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=9KwtbTNhxK6QLwV2KuYR/1Wk3sxaWn7bUkVHDhGR+MM=; b=AoVKetPQGF2gzntJy4pX8G2I441iOYYU5olNiIVuLatWPPMDRLPdG9BIiR4QsCU5Nt ekub/NdpcgE3e144xK1VCK+zr2NlCT/b4Q/SK1/YAq7krVyEcDbBUfb+IfTwDA7dkc16 YxtnOTGLIcTkBkP4QCpkrn/w+/Ky1uc+Vewm6VOoXLjj+4dPVR7HXTuESHv+zUzqtcZ6 wXCZMxtD76VF/mK8ipihylO3W9x3Yg/cbDYz6s8mWyvHk2W53/YEWWeyFmiMgnmPu2a0 2GJRHUtds6kLDOCWhGBg+dX6/6wImWJxVLU6As2QTkt8Te1yp/5VkRLOngLDKzz/Slc6 bNIQ== X-Forwarded-Encrypted: i=1; AJvYcCX9G9+0xD7apPotnj8BXuuuQ/S29xPqCT3/Qem2mrE5XiF+groyQu5gFIQHfKnFxpJSxn4WEKtE/g6aMpEHR4AeoL7sDYxV/2zFqBW61XbAWYStJmM= X-Gm-Message-State: AOJu0Yz9BwsiFIF09dTXlfWsxoxd2rHwa7biukpLPtsbRCXnwmUwvMuW NFrEtgSspQZf39E4u4BGyP3FqJiFOZVh3yF+0BUVP6Y7xzIyGtP3lCnj4jOl+nk= X-Google-Smtp-Source: AGHT+IHWzR0X1/chVI5nyA1bbHhSLG/im51ue7HmP59m16YndqKv/URofmBboXJLf4NWv6CumXY1WQ== X-Received: by 2002:a05:6512:128a:b0:52c:f3fa:86c with SMTP id 2adb3069b0e04-532edba1f04mr2399025e87.18.1723647866779; Wed, 14 Aug 2024 08:04:26 -0700 (PDT) Received: from [127.0.1.1] ([178.197.215.209]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-429ded7cfbasm22313425e9.45.2024.08.14.08.04.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Aug 2024 08:04:26 -0700 (PDT) From: Krzysztof Kozlowski Date: Wed, 14 Aug 2024 17:04:09 +0200 Subject: [PATCH 5/7] regulator: qcom-rpmh: Simplify with scoped for each OF child loop MIME-Version: 1.0 Message-Id: <20240814-cleanup-h-of-node-put-regulator-v1-5-87151088b883@linaro.org> References: <20240814-cleanup-h-of-node-put-regulator-v1-0-87151088b883@linaro.org> In-Reply-To: <20240814-cleanup-h-of-node-put-regulator-v1-0-87151088b883@linaro.org> To: Matti Vaittinen , Liam Girdwood , Mark Brown , Krzysztof Kozlowski , Sudeep Holla , Cristian Marussi Cc: linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-msm@vger.kernel.org, arm-scmi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Krzysztof Kozlowski X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1376; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=eOLW+7XCSrgYl8oNaIQs1U9NSlOctUB76u7J7/B21Wk=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBmvMdrmXbX+7wxh+iBPMjSGusVfyVLcDmyopVEi Nu88lC7I1yJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZrzHawAKCRDBN2bmhouD 18SWD/9IPpuPdYyOE7Twj4hDzgTcOT9AIVyIT41gFT4Y4Z6jo8XeP+z5bovXs/kpHX3pEuzFq3h eyPfwoxpaUuIEY+UhO0808X6GZwdGqofvuRisDO6osxa11w+CVPKGqW5xJ6gUmOaXdoWUN4x12I TUDwvuGTZQ77KyG+cLBAovMp/YjDe+uqnkv9SHxh503dnBrEAanMsX7rtsWbywnhNmQc3MSdEYP MB3mZnzVxYepZNmDi6tBK6iz26Uc0sb3PX8nJQG9GsHN/M+OB42VMGegkPoxEB6eFAhbvkwtGjd hk95FjI2jS2r0psjHIo5+bUtUlZxlg1A/caT03HoixwHlXCv1I+R2VzgoHsw/mIxhItu+quTRI8 uBclKP91xKYg+M/+tAnFz+zwNuHUyT+JwYciz37mWfkYTnfdglfLz80ksdY7QiE9SNCqBHJmmU2 rlg9dHV8D5v9enKX6juMfbToc81LfN5HRCj2AFIH14lptzs0matpmHQWwR8r+lTimxzPQjQfGs7 4l9dtaYw8lcUPoWkRWWuy0V8eAwBjPh3JvdCL0Xi5VRgMp9BnqE/Vjni6DsVjMqcQ7gB0Jl23Gd wFkfK/kUNyJsQhXHmCppXV7SqODs0xCQ+cDpPLlgjokumG6D2SrLNi1+VPyIq93YuB9teHEAOLm X97Wj0+Qwn62jew== 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-20240814_080428_791638_1732174C X-CRM114-Status: GOOD ( 13.44 ) 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/regulator/qcom-rpmh-regulator.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/regulator/qcom-rpmh-regulator.c b/drivers/regulator/qcom-rpmh-regulator.c index 80e304711345..6b4cb7ba49c7 100644 --- a/drivers/regulator/qcom-rpmh-regulator.c +++ b/drivers/regulator/qcom-rpmh-regulator.c @@ -1537,7 +1537,6 @@ static int rpmh_regulator_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; const struct rpmh_vreg_init_data *vreg_data; - struct device_node *node; struct rpmh_vreg *vreg; const char *pmic_id; int ret; @@ -1552,19 +1551,15 @@ static int rpmh_regulator_probe(struct platform_device *pdev) return ret; } - for_each_available_child_of_node(dev->of_node, node) { + for_each_available_child_of_node_scoped(dev->of_node, node) { vreg = devm_kzalloc(dev, sizeof(*vreg), GFP_KERNEL); - if (!vreg) { - of_node_put(node); + if (!vreg) return -ENOMEM; - } ret = rpmh_regulator_init_vreg(vreg, dev, node, pmic_id, vreg_data); - if (ret < 0) { - of_node_put(node); + if (ret < 0) return ret; - } } return 0;