From patchwork Wed Aug 14 15:04:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13763633 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 AEAB9C52D7B for ; Wed, 14 Aug 2024 15:09: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: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=Uby3vx5C44xympQeIPbZuYUa73IoZNR3m1Cs5S0QTJc=; b=0I7l9W9AA/7VAhLdd1glvwOXpw pGeMWPyFBck68dV8jVX+9lD+mwRG6s4JNWaW3GgFi56G9AxSfX5NZiXVZxxaHRwctj/q8sLiai+qE I8kkmS26vVxph4pTcXCesAjn/RTkq2aYCjvD6A8b+8AkiHribNZD/0p6mczYL7L0EO7cYSggxWIcE 8eVJF0tsC+f/vL9nvdp4SgucTk5qS58OmXV4jfCTpwavKufDdUstFPN2fpk/Z0HEPMsqLMFM5GOW8 wFWdC4wfL8zcxo0KWZ/WKvGBd3gRCQGfyMZheblnSBc9OUrARd48aU7gbBBxgmozeosN0mg8Cjibi 96VId2ng==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1seFd9-00000007QuB-1104; Wed, 14 Aug 2024 15:09:43 +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 1seFYC-00000007PkC-1c9S for linux-arm-kernel@bombadil.infradead.org; Wed, 14 Aug 2024 15:04:36 +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=Uby3vx5C44xympQeIPbZuYUa73IoZNR3m1Cs5S0QTJc=; b=Pr8NnsLHbm0sLm4/52jhVvuyWU exyn/IbhGhEHxOzE8bSWWrWzCjNJJSFuWLi5i0g40Ltbevso/IngLiVew3SXPY6RD7eT07BGq3mT0 pw6Lslb2XUkvj9RMkhnOGlJ8a354mWXn0QVrhyou6qBwYiE+Fm7tRaf6qK/bPX34E4w8pQeJrJdEI 8xu2ufoc3/s1lu6KyW/tddjpLreLNEAJ4aQJ+v3ee44G3KfTAl1eagmQq/R34Yd4b079EwEXDBDpY GdLE2VhGdrCFiICCDTQIWuKIYrxmcdOR9toUEWVhkEIY3g8JDONZovRac27RAzOeFTAE2AwUoVrv4 thToKqow==; Received: from mail-lf1-x12f.google.com ([2a00:1450:4864:20::12f]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1seFY9-000000085K4-0Ipk for linux-arm-kernel@lists.infradead.org; Wed, 14 Aug 2024 15:04:35 +0000 Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-52fc4388a64so9490718e87.1 for ; Wed, 14 Aug 2024 08:04:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723647869; x=1724252669; 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=Uby3vx5C44xympQeIPbZuYUa73IoZNR3m1Cs5S0QTJc=; b=nJZJQqgrJeynmrsX2jKqsJ3sv7jzcbZDhCBRTZev2WTxsIhbEGb9t7rurdNWTOtIRu js1sZJePoWvMRUfrqpHfgwt7X73XOg3bVFEwNWuWQajUYm1zirwODnwBTKf8O6F8dOCu el/uPJ98cbfewo4M3VpMzYxaY3QHQXlnFY3dMBiEEJFj/FMHo1xbglNvRJ+8XaU8993M WunaI3Tx0zF7fPVy2jSbGhg+r0ZLl+YWd7sy6jYSD47Tlgj71qTyDx0cbOzypp3r5kaq 5TrWW+x3rjKj30phN2bUdGupSfsf0Ist/16D2V5Chh8VOfRs41Mt7d1wNWuaY3194aXw s+vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723647869; x=1724252669; 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=Uby3vx5C44xympQeIPbZuYUa73IoZNR3m1Cs5S0QTJc=; b=GM1ufBsQvulXvm+kXVndI7KT5ShF5gdd9KYrLZ1E+scjoTAphqSrcsMihv4IZlCyjV Fqovu3Mz0ZbsUo5fHJfNTi42y4jBHiA/MPveY2/6Yl9WNhPqAaOePqCt1XTS6ajQ5HSL GhAfNPRYsRtSvLMINhFcThzxRIAtE46cXLZ15uX4i/AII0hZNPyrJzrmfO4YyID06b53 KSEgQqJCx56+44GAQzVWFV3KIIp+zwVbd1AsPbba/qrzpJ09BJY4AyySK0cwtVAEzrrp Zrt9dn1YC8RKz+9Iq4AZ7Gi88kRtno6MGsQ3cVmbACUVHwJdQGyzUpex95zOGwk2N5tt J7bQ== X-Forwarded-Encrypted: i=1; AJvYcCXHQz+RHjM+Xkp+DIv3ySHlnsuyVau1ivWd7NDOFcc8EbFuZpcgn1hmOLnchAJ143WIBIVSzMBpzOJnZWpal++dHObzXffc32ANwi8lZTK5nLUTABI= X-Gm-Message-State: AOJu0YzUkOXSYx4SY/8qysfEetGDY4d4eiZV1FS4rTUr/YZZwm+eL5Ah bwtvHZf2t3ayFXSjT/qZ1Elxg8al/C+PqGlc93nASYYzJEPXZLGL4Ju2MQBxhYI= X-Google-Smtp-Source: AGHT+IGocQ+sfcCI0BsP7dFMq93jhRdGBeu3R77b4skm0zxlJaGhDpoe9Yu7aRhk+YK7m/4igocdpA== X-Received: by 2002:a05:6512:3daa:b0:52c:d9a3:58af with SMTP id 2adb3069b0e04-532edbbea6dmr1706687e87.49.1723647868534; Wed, 14 Aug 2024 08:04:28 -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.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Aug 2024 08:04:28 -0700 (PDT) From: Krzysztof Kozlowski Date: Wed, 14 Aug 2024 17:04:10 +0200 Subject: [PATCH 6/7] regulator: qcom-smd: Simplify with scoped for each OF child loop MIME-Version: 1.0 Message-Id: <20240814-cleanup-h-of-node-put-regulator-v1-6-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=1371; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=eBGTSGUpvddpWZ+1sT4gEslKcB5kBGvw5yw7ydkjC2k=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBmvMdsbGg5jhGJCbxxUs0v8Bv4OUF1uvi+EO1FC F3GEVhn6JeJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZrzHbAAKCRDBN2bmhouD 1yPiEACadxHRdHC3Qbt35GS0lKK/OD/r0A69dULWvdqQ1NN9HvfQaK5Hx7jbFXnjONsqn3KPMDC EGL0ATj/SWGAUxYjIXNk/EzUw1vF461IkUHUstovhu7pqEZsMTdS8t9YxFzYBOh5DdmOQZrfHtU SWFo7VISazhvpFuge/3lQS7L/NYMeb1k6nREZd926dVaoL15IJpyAnrbd+k5nUP9eHsOGTIinUF b2sdJ9GsfnIWvUh503gqMx47bBb51hauURzkb9g6CmFJd7Gwo6wbCCwlhp2KKWGsGywJ9vozaSH 8ggbvKEVF1TsTNPHI19jkqdRD7yySvl73tsQTe6nOg2ueJWvBRfjMuhcmXeirtgeW2vAJGShEjN /iJ1+ep5RSfkl5QEKfO4OreTj2NELrlxm2B2HzCZGxv6c8b1GXVjqLSWvELfR34stg4/RgKcV7r FGCFwPGoQaaq0tHYOglqBaX/KnHKCjRH3CK/ZrjyaOBcF2rRzgZLT/7g6hJDkerfOCx7qcB7lWU HRlK9/Ocgj0gVyfCHppH4q1/bBtt33K0osv+E+1L51Hl5J4LWqMkDIaCo4pnG71h4lW8DGXYATs On62TrglDkCpWgvmimD3jbo704nE2gh/g+kZPrLN1lEEf33c5BKh1Nku83Oywr3QkwXySFt6d8R jrAv31M2iAyjOKQ== 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_160433_540642_384C7B5B X-CRM114-Status: GOOD ( 13.35 ) 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_smd-regulator.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/regulator/qcom_smd-regulator.c b/drivers/regulator/qcom_smd-regulator.c index 3b7e06b9f5ce..6761ada0cf7d 100644 --- a/drivers/regulator/qcom_smd-regulator.c +++ b/drivers/regulator/qcom_smd-regulator.c @@ -1435,7 +1435,6 @@ static int rpm_reg_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; const struct rpm_regulator_data *vreg_data; - struct device_node *node; struct qcom_rpm_reg *vreg; struct qcom_smd_rpm *rpm; int ret; @@ -1455,18 +1454,14 @@ static int rpm_reg_probe(struct platform_device *pdev) if (!vreg_data) return -ENODEV; - for_each_available_child_of_node(dev->of_node, node) { + for_each_available_child_of_node_scoped(dev->of_node, node) { vreg = devm_kzalloc(&pdev->dev, sizeof(*vreg), GFP_KERNEL); - if (!vreg) { - of_node_put(node); + if (!vreg) return -ENOMEM; - } ret = rpm_regulator_init_vreg(vreg, dev, node, vreg_data); - if (ret < 0) { - of_node_put(node); + if (ret < 0) return ret; - } } return 0;