From patchwork Mon Aug 12 13:33:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13760598 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 79E75C3DA7F for ; Mon, 12 Aug 2024 13:35:52 +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=lgTXsPloyXfID4jwvyIhu24dRWJVHUfhWh9HifazGOU=; b=f75v4C6UitsHhqiiUKc7oIIR3k L+z/Lr/xbBYF9K809wx6QtTYxeH3TfD2VqEVuxW93i2o000bqHzccYfeIEMl+sMkIWp6gxvYpAsCB Jc4TCTTrMlRhKFMUW6bDIB2NcPaeoreHQkXb98yFHMlQW+XWx8JDcgAc6U37I4azcpcof4Sp9tRkx av6p+1lqpWuhLJt6JDY21zKHisbSq8ok/59YaFS6yWJPaM9F0UHRiOBlSgAME6I83drH/XON8p1bi DE5pH/HBw2ZD5XxrPF5gelnTrxwyJG9Hdn5dIxBBBU947uea+xMMlcOvuqS7R6CpMHWJ9NQw2mkCy YlYS51HA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sdVD2-00000000RM3-381l; Mon, 12 Aug 2024 13:35:40 +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 1sdVBt-00000000R7R-2zX3 for linux-arm-kernel@bombadil.infradead.org; Mon, 12 Aug 2024 13:34:29 +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=lgTXsPloyXfID4jwvyIhu24dRWJVHUfhWh9HifazGOU=; b=WhVSoWOApQcOABtTM3mkCZDClu lQQtv5zhbRa2XbN/n2nqevobzVsStik9p940f5+/a6C9KwtdveHqkpFtSu0LEWa0veIV+CjDUpwtD SZYoV0qpr2QJmUT2Bz+iq0509ZRVxdcaPoa6caV22ZAxL6fIlZS7/N5GMfDpbMbpvTYf0mngpnxd7 y44BxkBiL8HAyaA3dwcjN9qYnSPwFQ9yPfjSzCFVytP21pIjx4kkAnPamkhHQ48rVOE2tBGerbuXG 1uJiLjxOyVnCM9+6o4CYgJbBlVt18VzwSQ0S73dBXotvAQM7sKrqd3k+g2hBqJq23JtGMvn7WlDhK KfS0Yaow==; Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sdVBp-00000007ZYr-3n8z for linux-arm-kernel@lists.infradead.org; Mon, 12 Aug 2024 13:34:27 +0000 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-4280ca0791bso32318655e9.1 for ; Mon, 12 Aug 2024 06:34:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723469662; x=1724074462; 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=lgTXsPloyXfID4jwvyIhu24dRWJVHUfhWh9HifazGOU=; b=CvReShf91DW21JyfUon8fq76LEDKTGzQnz8qTG+CRtATzHlc2bNKJhXmw4MCUqUADA 7uIeHzZ0Zagxk+0p4XA3zq/cfXFuC9iUytdMidQambDWiopE02Z+tC+D8uSQLkeR/TeP S4nOrQOJpXwoTBkdtHXlJ1CNxWlEMTP66YmR2dvPR7nGZ7JwyIzTBAP7HGUz4S4+3fmX axfkN9QEmng5qNo1I1rpg1kvnWH2yOA5IdCOTLkJmYiQ1i926MBjpn79Ns4LX332Mxeu r2NDR7b2YiBZCCx7xn4RXLCmuUz2OA/VlCdoBqqsD10fQ/+Zd8k+MQl6cFzTklaw+0DZ bHvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723469662; x=1724074462; 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=lgTXsPloyXfID4jwvyIhu24dRWJVHUfhWh9HifazGOU=; b=tyx1idiB+INS24NH9Z0GbkBN2SHz2rTlZ/HxpgxXHxhpL7J75hp1RnikAnENumyX4t x++d3HN0k5nas36zgosTUIUgALPJQ2sErumIEvV9UWi1NzQQb688jyzW6g6Fb+/vFdov Z5cv6Ocl4b3n7lSK1U7qHH5H0La0Qy+jIix+DECbMOjBi8Lgw/aN3rmrl5LZJDfKumFO 4CTcRZYQeC+8radagzKjlzm/klK56zrW8pE3kfHXvXRwqPgYNwqljM4OjeWSWhsdX5Ff te3PKlwEo3Ljeb1sSYt1nOgVmG405WwivJM/ldHiNEcWoEbgf2nX1kGxP/LFJ8lzOpVs obnw== X-Forwarded-Encrypted: i=1; AJvYcCXUaI5Egh/sPmBm+AsHBAMtExSxbMQrMBV2DUUMG/Ypp36h5Cgf09vctTQn3cG8qijhJ/7/zpZE80NB50tWUI9D4W//TzsGq1t7SXHyjCxxsVIGk7s= X-Gm-Message-State: AOJu0Yxir4qAu0ifqdnWD1m248dk70kHYP7kvWvOH5xHZojEUI8mToQu Y2PoelCdJS78wriqIr0gtXXit5gUuHJbdp29OETBquFfKVO5le+JNHnl/qsC1cw= X-Google-Smtp-Source: AGHT+IG2U+2ivgdNzf99p2ylaUjGb2UicWlTptEg4n0FqVE6AqYOjcDIhqYbh/ow3uzGl5LVUnouOg== X-Received: by 2002:a05:600c:154d:b0:426:602d:a246 with SMTP id 5b1f17b1804b1-429d48976c4mr3808995e9.32.1723469662493; Mon, 12 Aug 2024 06:34:22 -0700 (PDT) Received: from [127.0.1.1] ([178.197.215.209]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-429c7737c64sm102733975e9.31.2024.08.12.06.34.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Aug 2024 06:34:21 -0700 (PDT) From: Krzysztof Kozlowski Date: Mon, 12 Aug 2024 15:33:56 +0200 Subject: [PATCH 2/9] memory: atmel-ebi: simplify with scoped for each OF child loop MIME-Version: 1.0 Message-Id: <20240812-cleanup-h-of-node-put-memory-v1-2-5065a8f361d2@linaro.org> References: <20240812-cleanup-h-of-node-put-memory-v1-0-5065a8f361d2@linaro.org> In-Reply-To: <20240812-cleanup-h-of-node-put-memory-v1-0-5065a8f361d2@linaro.org> To: Krzysztof Kozlowski , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Lukasz Luba , Alim Akhtar , Maxime Coquelin , Alexandre Torgue , Thierry Reding , Jonathan Hunter , Santosh Shilimkar Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-tegra@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1350; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=gmw7sdXN++0ul8rDzvdEpJ8YQFeG56dlD4XcPKrvG+o=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBmug9SBLK2/VucpJF/zx5ZBYvmfrRBNn21ar0oB 3a/Cv0noJqJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZroPUgAKCRDBN2bmhouD 1+yYD/4qcA8Bj3tzEWx6jyRjX8fDvf+bTdrauIEu4tdm0NhBSOPEGsMhDXH6CgHSvmu29T1Kvz4 ZwZ+2AAdDjZmdWXiU9FiAnN0Q33OjNkDRlCR8sEXjyPyOmXnjgzL40SEALgNKIZi4bpTvB8XX2L X1RJgqy8kocB79a8itpXzdUz9K6D9nHmPXj31YzY8qhiq3bGZrMX0UayHyFFwZXzC4+MvpXbxpE 0IGsNG3fZTX84XsBX8bMvnV/Dz6Qh52B2e5+3gd9szOpKHYQjmw8sqJO+VzdNJ8WexnOV1SJE7I qd4gUgPlThSU/cCUNWlsl0UmvrA2ksWUVvqU0BKHOj/SEmh6VCnJ0sCtEB9v3sjVC0uH/KDQedm 1gwdxLTsFJugS6pDjZd3lpOH26QeWPz35qwz2kWyoFTFFhMDtygj7NtFrX/rXbXI2P/ykR8PKo5 TYETYdEEHdUE+q6d8/kWbMERlzyuEcyKeCTWOndMO1tmQOyoV2g2JgD4a1ubtmwr/LSLRU4YldQ mAqYO/LNC3hE9xUwtG4Zyb+KI3NZLLfTdEOYgTIIA6HLUEPlN3wrmq/7UsP+t1+DPndJVaruZn0 t50YYT/Qalyd0LGdIKkExmcImtEVJs7HbFZn784DibyT6IaArLfY99yM9caNxxgpedYMxOdsMT9 lDEND5PW7HyCZAw== 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-20240812_143426_126814_1BE1FA03 X-CRM114-Status: GOOD ( 14.42 ) 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 Reviewed-by: Jonathan Cameron --- drivers/memory/atmel-ebi.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/memory/atmel-ebi.c b/drivers/memory/atmel-ebi.c index fcbfc2655d8d..abc6c067b5f1 100644 --- a/drivers/memory/atmel-ebi.c +++ b/drivers/memory/atmel-ebi.c @@ -518,7 +518,7 @@ static int atmel_ebi_dev_disable(struct atmel_ebi *ebi, struct device_node *np) static int atmel_ebi_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; - struct device_node *child, *np = dev->of_node; + struct device_node *np = dev->of_node; struct atmel_ebi *ebi; int ret, reg_cells; struct clk *clk; @@ -592,7 +592,7 @@ static int atmel_ebi_probe(struct platform_device *pdev) reg_cells += val; - for_each_available_child_of_node(np, child) { + for_each_available_child_of_node_scoped(np, child) { if (!of_property_present(child, "reg")) continue; @@ -602,10 +602,8 @@ static int atmel_ebi_probe(struct platform_device *pdev) child); ret = atmel_ebi_dev_disable(ebi, child); - if (ret) { - of_node_put(child); + if (ret) return ret; - } } }