Message ID | 20240812-cleanup-h-of-node-put-memory-v1-8-5065a8f361d2@linaro.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org> 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 8E8AFC52D7C for <linux-arm-kernel@archiver.kernel.org>; Mon, 12 Aug 2024 13:38:47 +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=oAYRAyLvoG4oyvTDF3Z4505Z3pwRnY5SCeviwv8U1gY=; b=BZbP5XKWX/KiGH+32zCijAXqWv nhapvYiWIj+g8Jx5kdvCjXSAhd5tv9KmzeCPGlufGl3FzA+qlzL4RIGHCHsCWbQx3uQUeipVk2Dp2 JDP+dVmRE94uunwOLYJbD2C1KWk9EzQqp3f/Po1zzjuRSLWBvysYmt6oRiBktYFxM0IHXVm1jm1Tm wBdWYHuGZG1czxEWMU4/WZ9s5ri+LtSnEcy47G/RCrLbo4nY3iSKqk4w/5BC74fvsR9QACV+BrV8L WB6ctQBq9aZcWou0u0UG6mSdTkU9kNE8vEYNUwokr1d9QMdgftW3V4QGIIebDGrDiX8EJXudozZo3 j2mvwTFg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sdVFq-00000000Rsz-0aFj; Mon, 12 Aug 2024 13:38:34 +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 1sdVC2-00000000R9l-1bq7 for linux-arm-kernel@bombadil.infradead.org; Mon, 12 Aug 2024 13:34:38 +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=oAYRAyLvoG4oyvTDF3Z4505Z3pwRnY5SCeviwv8U1gY=; b=jryg+Rym++DICZ9KQkNigcZZRR XzCZGttNd83A87FMPSQUFBOPm0njInTT1rxbYve5pxtooVR8Fr6JpRb/D171zNmdDNsZDCbCl8PyG oq4Dsqnr+2kdxs+54fok98TMHpUzHgZFesh7BscGxENDNpv8Eh3d4+74LlUXwwKnJtbTm6lMFQfXH nk5AdQv1tMfOFpVAP3Qi7assUMfNwQIfxLNzpM+ypKM0M9RGrAoVtcMKNoGLyagC8T+vgtBuHzlIl z0bN1h98HHOqy0n8ewehmkERFy1Q8zPLf6DlNh6YyJfCNkSW/mwhoB09Er51oLXmQCTmZ+3ghhhgn qABFS9ZA==; Received: from mail-lj1-x22d.google.com ([2a00:1450:4864:20::22d]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sdVBz-00000007ZbE-0Z9x for linux-arm-kernel@lists.infradead.org; Mon, 12 Aug 2024 13:34:37 +0000 Received: by mail-lj1-x22d.google.com with SMTP id 38308e7fff4ca-2ef2c56d9dcso49656881fa.2 for <linux-arm-kernel@lists.infradead.org>; Mon, 12 Aug 2024 06:34:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723469672; x=1724074472; 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=oAYRAyLvoG4oyvTDF3Z4505Z3pwRnY5SCeviwv8U1gY=; b=e289oD3HFrL2j/ZGpHBxY2PGRln8EiD37NqlMX9xurGsoY9lCh+suAYlFqfMlir11m RTbCfx2CQU7jhJQg4l6cgzKU7NZgADfxEyC9f1XFxzQSZ0UI/tytpWHUZr8VmwHdtPME fXHQD9XrIMRCRqNi2juF/rPJn7h/AJd9Z4pL3BhvPJFIyf/cpGwvkqi32+8Qvjc6+r1b Ed7F8mB8oEKV7kEKz7z1qv4FAa7ZOCOHY1jr9jwWsPiRVOrKl5fFV94byc1oGQY0k6Xs XVBBXu3vFyEtDu5DTeW6aX9mUGfq+NJVKvuTm9rBkVMYLnW0nmu1EAWHraoLIhjjinWc agKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723469672; x=1724074472; 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=oAYRAyLvoG4oyvTDF3Z4505Z3pwRnY5SCeviwv8U1gY=; b=C8OsZguyF67Qtn7P4M+GwF1rF9eTXGDhmq5IocWppmdz8FJbySooc2/ib82MPW8+7w T6KqGFVxbVEbDR5F4HauKNVanUbC3OKzYPBjnZONy6CT4hKlQOPQLm4DCmSK10iP7OgX syF2Xf3AqLAO6Dx9hF0iu9up8PqBt0L+a17Zec/ASan0WZbQzKn5rRQB+BtjwIHzD7jA q3EuhKWp91p7DE95uQFoIII6CNJdCS87XSAWrV5gIA6y6zTflkJXiOdUDVC7PQB+4bg4 jiCQifN35wJhKWhuaUKfzBj2lwbSGXjjOR7PXKcauvMJJfTNCoIpdwR0Q56zPwstHyYV ou1Q== X-Forwarded-Encrypted: i=1; AJvYcCVPEdRKsxHc18mqabGm9KEshNKt7HAHzsE7NCEeT/xbZzjoECaRi7tbfDQ6H3dT2T62QcQAefr45+y3pebRjOFYQj5C7xfBhPUpDul03p6WNHbJJ6o= X-Gm-Message-State: AOJu0YwDJ4d8MQ+bSgmtVgPDJPjaK9IFj+tOXv1JLhcLU1GoNePWzxXo +GQkjPx82Br17IHbUhx3B2aVyc78sNffZrOHsPQ5zGQBrumPcCPqIo8AVHfMWyc= X-Google-Smtp-Source: AGHT+IF4Zea8h7AbclFyhVQtS9eZT2Tc6EMfJdGvwHFdzc3KpbF32S6sd5GGemZ+KlUJ1S/LzaVfaw== X-Received: by 2002:a05:651c:b29:b0:2ef:2281:2158 with SMTP id 38308e7fff4ca-2f2b7132d7dmr2306451fa.1.1723469671912; Mon, 12 Aug 2024 06:34:31 -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.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Aug 2024 06:34:31 -0700 (PDT) From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Date: Mon, 12 Aug 2024 15:34:02 +0200 Subject: [PATCH 8/9] memory: tegra30-emc: simplify with scoped for each OF child loop MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240812-cleanup-h-of-node-put-memory-v1-8-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 <krzk@kernel.org>, Nicolas Ferre <nicolas.ferre@microchip.com>, Alexandre Belloni <alexandre.belloni@bootlin.com>, Claudiu Beznea <claudiu.beznea@tuxon.dev>, Lukasz Luba <lukasz.luba@arm.com>, Alim Akhtar <alim.akhtar@samsung.com>, Maxime Coquelin <mcoquelin.stm32@gmail.com>, Alexandre Torgue <alexandre.torgue@foss.st.com>, Thierry Reding <thierry.reding@gmail.com>, Jonathan Hunter <jonathanh@nvidia.com>, Santosh Shilimkar <ssantosh@kernel.org> 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 <krzysztof.kozlowski@linaro.org> X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1224; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=Qm8I2XYrN4e568eaRkgeUjoCW+fRdkjecwXHEHRljxk=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBmug9X8NotaoXkCeoFvECQEThprz5ONHsMuzD7b NbNcj+DjQaJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZroPVwAKCRDBN2bmhouD 19OvD/94A99rooiagSr1yUUB3q7Tj/0CpbQTlx8GEwagkJMZgezQJ8fSt8lsJRwMBXaisbT1RUu /ugtoQOyBWqkLkCZWhr/dt2MLe/xTHkqATxxMe/q3D+SgaGpBqnpb8s3OCcUoLRH2zLUgkSNI/B uuVVzd55ascHajpNWi6sBkx/4Ze24W/M4Kzrur9iytpTE0r8vhXx66INDaF8DWK1OKaSFR5C+87 Xi3jQE9JUlz3sNAXyieSjga2IaM8ORwSZu5uDrQ9H5dih3U5zFbTcVXbvZgWBaehrOS6NJfiCd8 SzqME8XywWSTxtLCXarn4TdGn3FqnR/O4walESXFoC2LygReE3WiwB/R+ZBHx3iQ7m+4NGDKZK6 VBpdwrbh0T3/x+HpB1Q1KJZvfqxuUUEOFea5K/1geiiMiFJCWOk3r7PxgZgoHWn4SwuTSHrvFYI +219oxZut/xhcq+BqRzL/oR4EZ9TyOFAxpt7eqTU670YOGIom6tb2FG/KaN0L2UuCqlodmYVNsY iJbDxcpq4gIrMimT2QT6S+AsS5JZAIV6l0Rg+otm9KBlrSMLK0JFVzGsM/vcvY9suDvqXV0rtwP LNsXWOvL2mgzo2mkBI5TGQ0g7g9fhaRALj9GU1rbiyjbDY3dZneug64Vgj4jUmWBINShFwvH3ag Y/cmVhGViQKghBw== 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_143435_446146_3F13974B X-CRM114-Status: GOOD ( 12.34 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
memory: simplify with scoped/cleanup.h for device nodes
|
expand
|
diff --git a/drivers/memory/tegra/tegra30-emc.c b/drivers/memory/tegra/tegra30-emc.c index d7b0a23c2d7d..921dce1b8bc6 100644 --- a/drivers/memory/tegra/tegra30-emc.c +++ b/drivers/memory/tegra/tegra30-emc.c @@ -979,7 +979,6 @@ static int emc_check_mc_timings(struct tegra_emc *emc) static int 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; @@ -998,12 +997,10 @@ static int emc_load_timings_from_dt(struct tegra_emc *emc, emc->num_timings = child_count; timing = emc->timings; - for_each_child_of_node(node, child) { + for_each_child_of_node_scoped(node, child) { err = load_one_timing_from_dt(emc, timing++, child); - if (err) { - of_node_put(child); + if (err) return err; - } } sort(emc->timings, emc->num_timings, sizeof(*timing), cmp_timings,
Use scoped for_each_child_of_node_scoped() when iterating over device nodes to make code a bit simpler. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> --- drivers/memory/tegra/tegra30-emc.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)