From patchwork Mon Aug 12 13:34:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13760601 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 0B4FCC3DA7F for ; Mon, 12 Aug 2024 13:37:39 +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=HsPnMwUlmEcWVK9mERUpPYYwG4/ZxKmrdaWPZk7BfDs=; b=Kyf5qO5GEUAHsY5d6VKRiW0cq8 tKhxhh4UD7mPXlh6M/GdQOGVVfgMoohs8fpCCH3T67N4h8uzUBgpdJrLcwGPqX0Ndf1RZHyeBoAie 7uwGwmINDUzlWnIaBRklBb9AkJh1Ymj9JqYBvidx58xJpmdm8WJ4BVyHlJO3FSWExuOBbEzhVZgYT mkACbc1cjF35sDEjOhVQEhu83N6P7DrX0QWTW2K5T413cygArqFGzJz5EE2VpDRV4n8ZTHpPbbb2u p0L5eeOyLtVQfwHXVX4WP7pBEzhh4acga89qDPhAtbIdxYVaLwhRncssNCrNEIgPozirQSPmOCJtD UjS5Sn0A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sdVEj-00000000Rj0-2i51; Mon, 12 Aug 2024 13:37:25 +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 1sdVC0-00000000R9C-1DgM for linux-arm-kernel@bombadil.infradead.org; Mon, 12 Aug 2024 13:34: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=HsPnMwUlmEcWVK9mERUpPYYwG4/ZxKmrdaWPZk7BfDs=; b=PdFKUrx//fwulRFgack1LRDuzG MBy38Vc7eeQLGpjIu0ddQJEJjc2iLcKvvBuHhe3q3xwFv6R9I/7VmKDQVr3XI02RxH4gHzZAmDJPm CrAARAYpHfcMssINA7Xs8ZfXA+XaKLeW8lT3AS1uLkc351uG8dWVEqXPzz0RJumVhwHuL9dPGW5jj Ame3zB2TPshk5d/g5InDxz8KHlLQBj7x/QydpMKn+U13CrNMCDvblz8XYP/HkWBMj+tgkwwy/HV5H JzZb4V0WEia1xh2byuY2W0wzP2nVJCQAp1nh4z3WWq0Z0cRFSnF73SlkmMoAuy2ZKN+Kb9/NaueQq beGPXF7A==; Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sdVBw-00000007Zaf-3yPY for linux-arm-kernel@lists.infradead.org; Mon, 12 Aug 2024 13:34:34 +0000 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-4280c55e488so25330705e9.0 for ; Mon, 12 Aug 2024 06:34:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723469670; x=1724074470; 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=HsPnMwUlmEcWVK9mERUpPYYwG4/ZxKmrdaWPZk7BfDs=; b=xGvPO9CLhaDa63DMXxWCow8esELgT13qOmo9sqdC2wvVkb6OC0CPdF36a8mHARpgVd iFEXNcAHVzhhXAF/FLNt7iRRN47QupQNauwxt6WFPL7cbTESQg3s9GyA5WhclPtMpxlT s1m5bnquW5iizsPFhQuCjQDeP4RwgFiNnm4vBLv3fRg74DELQbBVZIvlICT3BfaRAxfo MW0ayds7qqf6cRvhHqvjTbgdG3QEdq1//dF2lXxcZDHWDKvLt88rxO07abWsE4wUKYst 136WySrdoy/af2cWtKBra/1Ozo+/HxKmEKC6M+dG47hHF4K9zJILH88fRZCUmvgLkenF J7KA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723469670; x=1724074470; 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=HsPnMwUlmEcWVK9mERUpPYYwG4/ZxKmrdaWPZk7BfDs=; b=e/O/lNpcieyPSt+ne2UKCK8P6s8uc3Gv4+slz0c0Xm+7bBxvK6LkeRiMaMgBMe665w qyQupSCdUF3z7LMKUDFxBzf+70XQrMLHZM1smIJj1C1JqHHkejFgoFTABbILDTVNg6mj K/stVBqsgtWeNC75zx4pPiBC/pwS+ugeqKADNrymLGh5EbEZjhW01YwukHCsQA2jnbDN xxsOeaFpJ4A4cz7bi/9WNpDBXmfC4+y6DB2bYIyvZleaGadtakj5TEmzF56Tai/OMtlg KZ/cRvAhppd+uBoqr59H8/Ihae3+g/dZNkORZ9ReY4AbGKNvoUZydM+K++HYya8KqXm/ PXoA== X-Forwarded-Encrypted: i=1; AJvYcCVjb3ztSGIBhwGrDHtspDyqp8oAeXqOIxYRTxvsxJC8EVp4XzgKjrTbi0kbf8XWg6UuX76HJWxAxs+TCssRwBoAK74xlKQ9BSRB1ghm5/9cEmWkkMg= X-Gm-Message-State: AOJu0Yz2tUic2xlHyV9J6+cuHMGgJVkrs0FO5WcKoJ1vdCtSOR6i+3Hp 827ErcFWXeeA7u8DbEQf/VdB4J2TuI70dlx3+nIwCE8EIsnGbGpr5DJ0OITI81o= X-Google-Smtp-Source: AGHT+IGNiDAP0NpC4elbocTXmRTxZwypqEwP2T7NoNQBek7gp6Czs1sj30tLHKhrLESNRMviHtEwcw== X-Received: by 2002:a05:600c:350a:b0:424:a401:f012 with SMTP id 5b1f17b1804b1-429d4ce06abmr1140655e9.3.1723469670362; Mon, 12 Aug 2024 06:34:30 -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.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Aug 2024 06:34:29 -0700 (PDT) From: Krzysztof Kozlowski Date: Mon, 12 Aug 2024 15:34:01 +0200 Subject: [PATCH 7/9] memory: tegra20-emc: simplify with scoped for each OF child loop MIME-Version: 1.0 Message-Id: <20240812-cleanup-h-of-node-put-memory-v1-7-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=1217; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=0agCSQdAmRYcJrMldLHC+cO/HYUzM/jNOwE7xvoTJWs=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBmug9WsUwse3YgLVrnCc6/fae3A3AcursWIyaSR hcKG6MOheaJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZroPVgAKCRDBN2bmhouD 17skD/4mk0mqH2rEuc6Lpcv9Fk9Z9Ofg651HdFCPIT9SXWaxdSmtuzFF10HgMdna2jAU8gVSx5a teBho/PIDCcTaBnRl2nfMGaohe9F6FvBXUBt3gyoUK8ws7VHkvJDSa/KJPlwupUztYS3WvUSHFJ /EKc9LxNYJ8WOl4h+a0KHjCPQTOMJphsYrmP5wO1v5mHNoWuBnbxURpMSzEe0EXtHGKbL7ftoyN V/BvKwz/AlFcGp4vn7CRcjByp042rkUjWrM5C4QOffDdnaEVCsGlTdPd+Q9j/oGG1oPiwjNj9Rk EJXOpzGg5QR2OlVBAR/BiPH/O17Zo3xLAKEYGwnEv+9n5xQfoRhFkU8txLoW6kUVxO5EHRHQ9Iq VYYUKRr3n4cNsQXegkWk0h9MKqG2jWOe/sLHWWTNQTxBLqOo0PtVSqPwNVK0Yo4xadzdNZ4B/xJ DVjB1RIhzwfhUHHCqwIVYmOMmTnMUTTJZz3r3S0skj4aAHPWpyPj+S23pPD8bzAWFXDWETY+Vsy Qk3XC066YomliavGy2tfSIyRH61lPSAHFkN3db4nQcAqKVS8DlXh1sFwiBMUK1q1oAPQGu22y9J QwLihlnuAYhwjSTYotz/5tGVxKjNaIefeTjk+X+fU46eFbpPJpU7TYmqN7iQqDK38/OJ8k+YGO5 /7zMI7a8ZaQdSXQ== 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_143433_183486_2127822E X-CRM114-Status: GOOD ( 12.87 ) 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. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Jonathan Cameron --- drivers/memory/tegra/tegra20-emc.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/memory/tegra/tegra20-emc.c b/drivers/memory/tegra/tegra20-emc.c index 97cf59523b0b..7193f848d17e 100644 --- a/drivers/memory/tegra/tegra20-emc.c +++ b/drivers/memory/tegra/tegra20-emc.c @@ -410,7 +410,6 @@ static int cmp_timings(const void *_a, const void *_b) static int tegra_emc_load_timings_from_dt(struct tegra_emc *emc, struct device_node *node) { - struct device_node *child; struct emc_timing *timing; int child_count; int err; @@ -428,15 +427,13 @@ static int tegra_emc_load_timings_from_dt(struct tegra_emc *emc, timing = emc->timings; - for_each_child_of_node(node, child) { + for_each_child_of_node_scoped(node, child) { if (of_node_name_eq(child, "lpddr2")) continue; err = load_one_timing_from_dt(emc, timing++, child); - if (err) { - of_node_put(child); + if (err) return err; - } emc->num_timings++; }