From patchwork Thu Oct 10 18:06:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13831161 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 AC03ED24455 for ; Thu, 10 Oct 2024 21:16:46 +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: Content-Transfer-Encoding:Content-Type:MIME-Version:Message-Id:Date:Subject: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=dh9jzHed4iHtpNT+mC29RrRHw87Tek3l7JegVCBCiTc=; b=Jq2bWv0lsRHff7 5YBa9B9VFbjnoYO01Tq1C+Fez1hskmQHYxqOH3LSiwUg2p4IEzVCYZNV3VXBTh1xP1BC6tAaDRo+2 vVuu4URFPzZQlUv0VwejV7wtkiV64eNaEcBJc8jM0dlpW32SAtaCoBWymUuCoKJVue4v9ClXv4i5M WEr7LjWKU8Oj5f9OCRsqpdsza6LdNkyr9RpnxFGihIpBtVZlX7ZeQEZYgHR8DX/KaE0VWL+zeAUlP /jA8o2CjPu9R81FDw4VscKrL8T9jd1C/pU6DqnKhspJ2+5Ha2v7GMpyBC3gJ9sgR0UROB2rJ5vhAn hlSR9Zr528nQ2gq0XEnA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1sz0WG-0000000ENV7-2Ohq; Thu, 10 Oct 2024 21:16:24 +0000 Received: from mail-ej1-x62b.google.com ([2a00:1450:4864:20::62b]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1syxYY-0000000DmdT-2tCC for linux-arm-kernel@lists.infradead.org; Thu, 10 Oct 2024 18:07:13 +0000 Received: by mail-ej1-x62b.google.com with SMTP id a640c23a62f3a-a9952a6020fso16809266b.1 for ; Thu, 10 Oct 2024 11:06:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1728583592; x=1729188392; darn=lists.infradead.org; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=dh9jzHed4iHtpNT+mC29RrRHw87Tek3l7JegVCBCiTc=; b=z5jCdXJFFF1knyetladIPWUEfVOAHnKvaTbYSg39zgsKU6J98u8hN1D/HDFqWBzvqL lZq6dJnxK0mshBksp14QhSvrbVLz+4vm4hwkrfdMu0SEHLLjwpi0JV+pgMEW3F//UOGz qTuU8lHPbj1PrSZvh+nW/BDGAya+o/wIjbuIyAR7BVQeyt9dGpgGIbWqsjx5y1pQfhAO HJZt4pZXJBTUS1p7xoY6Q5UjEicXEGi1T4LXXSN7yloxZvxV4dDKCb+AwfqupOz1rkzX Mpwdv7xnmuDUyFenvT6NJFHgp/fOofZZfMX8snczXXTLeWPLUBxBwmjLAK7vKojOAz7Q SOJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728583592; x=1729188392; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=dh9jzHed4iHtpNT+mC29RrRHw87Tek3l7JegVCBCiTc=; b=xBXjfqXOqaPyOfJBDEA9afqbol0S90R42XSsLAAHYUESjNdQLPLMo1OFmgWqkpq//1 U/1Q5AausKn+X4oROrS5Utmav0OXtr5YZR/tFQgJDJt1M1zoI91GxdlD9jRzkpI6RAw+ /dR5VcBMdwavgmI4DxrCv/2YuzdWT2WaHYifFDbSzwpsLe3t/tFPMW2HSAopvCN2xz8x vg6uF4xWicDJOQXqM1HzCGLfi0VgOA/P8Skd0T9qOsVRuLUObrdzrPrUFHkdkaCgnyKp G6G/xuOAUGn3SzUOVPuKuqroAgoklFkociabnDna62iFnd4mGN2ykS4s/EssQty4aM0n U9Ew== X-Forwarded-Encrypted: i=1; AJvYcCXH+hdr2r9iIbyko0Y2Pw96ScuJuSxUhJrnrkfkgowgpZsEqMbGPVHk/G90aCf0clUTxZDF9rJkSeC0vBmFA1Ww@lists.infradead.org X-Gm-Message-State: AOJu0YzEHdMW9zOU76dJYmVGT0z/RIyQu3RTtHpKbOvtaK0NRzCz63A/ C2wwb4uqz/08r/n8W+SwHbIE3nTpuJGjzsDpr05mwenZJX12E4OEibzn2jtaJAM= X-Google-Smtp-Source: AGHT+IH/q1rHxvsZeQmLwazysGoC8juCGw68dQcOWNtm8WqXVECTje8OvwIdl4Y4sFrXwSXOeWUKVQ== X-Received: by 2002:a17:907:72c7:b0:a8d:2623:dd17 with SMTP id a640c23a62f3a-a998d330186mr252167366b.12.1728583592409; Thu, 10 Oct 2024 11:06:32 -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.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2024 11:06:30 -0700 (PDT) From: Krzysztof Kozlowski Subject: [PATCH v4 0/6] thermal: scope/cleanup.h improvements Date: Thu, 10 Oct 2024 20:06:16 +0200 Message-Id: <20241010-b4-cleanup-h-of-node-put-thermal-v4-0-bfbe29ad81f4@linaro.org> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAJgXCGcC/5XNy27CMBCF4VdBXneQZ2JihxXvgbpwnTGxlNqRc 1ErlHevyaICsYHlfxbfuYqRc+BRHHdXkXkJY0ixhPrYCdfZeGEIbWlBkpQ0qOBLgevZxnmADpK HmFqGYZ5g6jh/2x6IaqOUdK72WhRmyOzDz3Zx/izdhXFK+Xd7XPC2voEvCBK0xcogY02aT32IN qd9yhdx0xe6F+sXRCqiY268U41U2jyJ1b+IUpoXxKqIhg5IVDXGa3wQ13X9AzMRbRR1AQAA X-Change-ID: 20240814-b4-cleanup-h-of-node-put-thermal-2268440cc6f7 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, Jonathan Cameron , Krzysztof Kozlowski , Chen-Yu Tsai X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1960; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=6/5CsTtyk8qtgKNWYxi/reJinJ1vnuHa20F1dTWzvi8=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBnCBecegjeWQzb4Wc3laTEoQi3P+jonW7yoXgKr +TB1cu12a+JAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZwgXnAAKCRDBN2bmhouD 1zYXD/9d658iajlkuA112erKf0/OWS5ZPlV8YRK8ApQxwvDX8eNX7zrw523JpvHOZ2DE18Bg/au KoLleXvg3uZEdBmoCtnq0dC1YFqb9rwpuV+vmfZIJcRz7c1X814BDf8+c0vgoxtyhljZSeU+iIH POWEvuw67FX4F9mzGCHo+3C25jPDuu19AFRn00BW6UXTr7++go/YVgdQ+zQoNyKWV5aOJAlgx02 HfmWsKK9CaW4biER+OqXEeIqLfIbTGoyC1ZJMsyjvifWNOEMedG4RIaqAxj45wyVxg0Dz4SIyMY ZRPUy2BjO/wthtglxFmiGsT4jaYqhcVHE+JvdzK9ZVAoQxvPZYJp8vGF08CwpNhwm07uxZDvCkg OnrlO3qm4MUJE3/dzbOQi0AVjlhBH3ngx2cXYr0/fvRhz0DHzd8bG4oCEbsOePN0/3QA+u3T8mi gfwUB1cF/tSrx9/DXwI2Dj72tPGwDPr7Eaf/6pu3SkK9ROCGkSTZwndQfEDySVemhuVD5LXKSd6 AaRdwhMi8pkZiqMqOc+UdWAP16mlGiVLZTOxwZQFKoGMl1cSM/+atj9Aoebvv4CUb8uR3hxvy2D YdeD9KSNebbSbSd+P0ba3BvsP74nPgZAze4TQIagMq3dCkWb4hYAqlhajfSXgVYK8/pdiEnE0CO 9Cg4BN6G1tcTEhg== 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_110634_778535_2B2F55ED X-CRM114-Status: UNSURE ( 8.37 ) X-CRM114-Notice: Please train this message. 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 Changes in v4: - Patch 2: rewrite, significant change: kzalloc() also with scoped-handling so the entire error handling could be removed. Due to above, drop review-tags (Chen-Yu, Jonathan). - Add Rb tags for other patches. - Link to v3: https://lore.kernel.org/r/20241008-b4-cleanup-h-of-node-put-thermal-v3-0-825122398f71@linaro.org Changes in v3: - Rebase, because there was bigger rework in thermal code. This made two patches obsolete, but brought new one: 1/6: thermal: of: Simplify thermal_of_should_bind with scoped for each OF child - Link to v2: https://lore.kernel.org/r/20240816-b4-cleanup-h-of-node-put-thermal-v2-0-cee9fc490478@linaro.org Changes in v2: - Drop left-over of_node_put in regular exit path (Chen-Yu) - Link to v1: https://lore.kernel.org/r/20240814-b4-cleanup-h-of-node-put-thermal-v1-0-7a1381e1627e@linaro.org Few code simplifications with scope/cleanup.h. Best regards, Krzysztof Reviewed-by: Chen-Yu Tsai --- Krzysztof Kozlowski (6): thermal: of: Simplify thermal_of_should_bind with scoped for each OF child thermal: of: Use scoped memory and OF handling to simplify thermal_of_trips_init() thermal: of: Use scoped device node handling to simplify of_thermal_zone_find() thermal: qcom-spmi-adc-tm5: Simplify with scoped for each OF child loop thermal: tegra: Simplify with scoped for each OF child loop thermal: sun8i: Use scoped device node handling to simplify error paths drivers/thermal/qcom/qcom-spmi-adc-tm5.c | 7 ++--- drivers/thermal/sun8i_thermal.c | 11 +++---- drivers/thermal/tegra/soctherm.c | 5 ++- drivers/thermal/thermal_of.c | 54 ++++++++++---------------------- 4 files changed, 25 insertions(+), 52 deletions(-) --- base-commit: 33ce24234fca4c083e6685a18b460a18ebb5d5c1 change-id: 20240814-b4-cleanup-h-of-node-put-thermal-2268440cc6f7 Best regards,