From patchwork Thu Oct 10 18:06:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13830655 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 00AC9CFC5EC for ; Thu, 10 Oct 2024 18:15:48 +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=zMe5HePhBUeYRfUt+t783COcyrs/YnND8+jdMLpIJ/Q=; b=RVrudx7xSQXPcMcYYLohnYxyhz PYLCb3HrofcSfLqo7T4oFDmK91jg3Cn9+vmkybcl3FiOxsRwhUN9SFAOgyGnlW9K+nIQaYDGiPT1+ I4dDxi9+owspr0VFrkVSS8fD1VGiZiSHPfUqIAnu8eGHjrVXaPifuaAj8KRKhxTB/ZY4Qa9//jbSa cxygPSJvm23lieOMI7hXOZi9Ja+q0TRr6UU1M3S6ATkBbDrMePx3x6AP4np/YL7I5d+qaDUP1s92F TjsIy4UqJSQzraOTzajQfQpbRjdgKID5YN/HsejuiYrJZzoI22D17Al/DUje6ZkIVPB4A96r2ybtn btL9uo8Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1syxhJ-0000000DnqJ-1tXP; Thu, 10 Oct 2024 18:15:37 +0000 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1syxYi-0000000Dmee-0U0G for linux-arm-kernel@lists.infradead.org; Thu, 10 Oct 2024 18:07:53 +0000 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-a99409f1cc7so17517866b.2 for ; Thu, 10 Oct 2024 11:06:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1728583602; x=1729188402; 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=zMe5HePhBUeYRfUt+t783COcyrs/YnND8+jdMLpIJ/Q=; b=Eh69q2yw+eKouyX8rK/ktBmH5sKQf3QEaAXJUG30ge33GRglc99md+S8WHBYcrQmTd KE4iCbq8bYr0r5cUhPe94maBZEwfI8+A1ipif6Mub8az6mqihRjLrxQ/E7phPOyspIM/ FtjYatu4TbOmebzj6FdZvMJeHE8CLN/5fTtldyletPBGE9luqksSl7WHTFnWWndfjisu xJ/b2NbRqNNTL6OLeXtueqvaVoZwJGgsnaGa2KM+e7omKDO4JShpWhrhgX02jY4wRpwl DA11yaVwHToiw0UrU3et2tvyavKt6Xb1FfvFpQlBynkj74ZlJUb8ZrQDk3TmJHoXk6HB Rd1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728583602; x=1729188402; 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=zMe5HePhBUeYRfUt+t783COcyrs/YnND8+jdMLpIJ/Q=; b=IVXcIIobbN/HSc20h3uxmkl99KpZwiQ5G/8caiEqi1ykBc179RUtCAfHrvGg/MM72f L1ir9Ls4wnBWvC0MzTeRHxnTeQNzkfo+uS49em8iVSthzowk/DETpp/mFF+H2XQ+73b1 D8UCI3lblLFv+ive23zb5sHAIlA2C665i0bn9BRqprf6Z6DMouVC9rlIPwGxkY1p3IIn L1yG9AdS9Ue82jt5etZ5oTz2IWXGI2bgvQMkwETWHlx7Le6+70QV/HLfReZJkU3Y9F21 WDU8OR76GawPlivz6CLawGs9Kxq3Vns5+XKq7xNp9zOL40TyQYJkqxmJjRHgdIXeXnZk rzqQ== X-Forwarded-Encrypted: i=1; AJvYcCX4jkF1w503DXL3dwhPgH1Gy2vVavFhvfvqSFvvfYP1aaUVMV68TIYhFnu8r0ddq/VIjxk4gtbUoo77xhrJajJU@lists.infradead.org X-Gm-Message-State: AOJu0YzUm/Ag/D3OdV0WhEoLROTYzgdzFfMDghlwNFA4hGt5Z2hUm1MY BULBB1P4UPZcrY6SMgDpN3wP65xMYZ06AMjbfylsVN+MT97z7dAYPAqRD7QVP41SpFZf/JiVeQY z X-Google-Smtp-Source: AGHT+IFjB63/jfrBk0eN6WcJADeEZxL3im8HrhNr5oZenhrqyJbL9Yal33sIcZCX4teS9nhkZm9GTw== X-Received: by 2002:a17:907:940f:b0:a99:6ca0:30cf with SMTP id a640c23a62f3a-a998d117c8amr324118866b.2.1728583602014; Thu, 10 Oct 2024 11:06:42 -0700 (PDT) Received: from [127.0.1.1] ([178.197.211.167]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a99a80c1b8asm119757966b.116.2024.10.10.11.06.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2024 11:06:41 -0700 (PDT) From: Krzysztof Kozlowski Date: Thu, 10 Oct 2024 20:06:21 +0200 Subject: [PATCH v4 5/6] thermal: tegra: Simplify with scoped for each OF child loop MIME-Version: 1.0 Message-Id: <20241010-b4-cleanup-h-of-node-put-thermal-v4-5-bfbe29ad81f4@linaro.org> References: <20241010-b4-cleanup-h-of-node-put-thermal-v4-0-bfbe29ad81f4@linaro.org> In-Reply-To: <20241010-b4-cleanup-h-of-node-put-thermal-v4-0-bfbe29ad81f4@linaro.org> To: "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Amit Kucheria , Thara Gopinath , Thierry Reding , Jonathan Hunter , Vasily Khoruzhick , Yangtao Li , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-tegra@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, Chen-Yu Tsai , Jonathan Cameron , Krzysztof Kozlowski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1477; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=BdGrjkiZQWh1WcuBimpPZ6XtKP2yiGuNF+kzNxp4Gjs=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBnCBejWV/QRORUzTaED875a/UAIUxkqjmo8EOWT kMOrdM0W7WJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZwgXowAKCRDBN2bmhouD 18Z+D/9J0c7qqVdhn8oGOHhT50RX0ZxNnG/KK59zCeLsNgdpi8PtrKyaLDCkg5tnoYFYe+s2Rtq 4/ULr0gtVWSYjewjs+JwL2DenODGLK393X9djFuOVFYTJAkZjKwOp9u9vm+VeyEPWcl2fjZ2BC6 9Yy4YtoH4iqpiwqsocJlCzguxZL7//bURxaHbhk+LbqnHbrwH9cKk+TecI3Ia6MATdkjt90b4OE ve40c/G5MAJOjcKCqgXJQkNiC1W9dQ+s5iQ1g1Y885Al3kHUKGi6A/cjqg5Q+JsfNJ73Q+k6rT9 C08DY7x5GWlpVRdkNKEl/K0+oGhZUGhxZFwvgBAl91HlIgRn8LvMjQw7EaWng2SlLOwMQYrtlS4 JxNaMGKbccQo2rWiSA7trOUY0dGMQOxTaYDh/n858DvzIKFgtQw8IxU+F2Kl01ljhF+j83Kg267 pQuqO8JhZg1tvBE/XFQknST/+ga35RiHIZWgTusHM1fK2mgaqs7c6/Zon6sOLf1uDfsi5Zy0NEw y/LQdfnWOvr1EmDljXe2YZSAedCiMpEA3OiuuI8UU6eiSjto324tSJdfNyps3kLwZ/hL2OylK51 XD74I51ro7VBUjK01Ou8JUDTG1qj9D/zbvX6BFPja9bPg6Hl9vRQP9yYKJqsV3Y7dWuWFsxpzKG GhkctaLnxk2P4hA== 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-20241010_110644_199367_AF43352F X-CRM114-Status: GOOD ( 12.73 ) 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_child_of_node_scoped() when iterating over device nodes to make code a bit simpler. Reviewed-by: Chen-Yu Tsai Reviewed-by: Jonathan Cameron Signed-off-by: Krzysztof Kozlowski --- drivers/thermal/tegra/soctherm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/thermal/tegra/soctherm.c b/drivers/thermal/tegra/soctherm.c index a023c948afbddd6d9fc1a00b2fe310c71147bda9..ff4eedb553fb6e78c94b714dd179193c244b6589 100644 --- a/drivers/thermal/tegra/soctherm.c +++ b/drivers/thermal/tegra/soctherm.c @@ -1651,7 +1651,7 @@ static void soctherm_init_hw_throt_cdev(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct tegra_soctherm *ts = dev_get_drvdata(dev); - struct device_node *np_stc, *np_stcc; + struct device_node *np_stc; const char *name; int i; @@ -1668,7 +1668,7 @@ static void soctherm_init_hw_throt_cdev(struct platform_device *pdev) return; } - for_each_child_of_node(np_stc, np_stcc) { + for_each_child_of_node_scoped(np_stc, np_stcc) { struct soctherm_throt_cfg *stc; struct thermal_cooling_device *tcd; int err; @@ -1683,7 +1683,6 @@ static void soctherm_init_hw_throt_cdev(struct platform_device *pdev) if (stc->init) { dev_err(dev, "throttle-cfg: %s: redefined!\n", name); - of_node_put(np_stcc); break; }