Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2067816rdb; Sun, 11 Feb 2024 09:45:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IG50OErCx/hE+ohgbgdEzB+nEGr7yOu+YjIDQ9dPMXr+oDX/BWw5cURmupWHplLnqHRkghB X-Received: by 2002:a17:906:bc55:b0:a38:59eb:f11 with SMTP id s21-20020a170906bc5500b00a3859eb0f11mr3789347ejv.27.1707673510860; Sun, 11 Feb 2024 09:45:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707673510; cv=pass; d=google.com; s=arc-20160816; b=BIpWVs0RugN2qpGkACVDg89yHpwytxAftSYJX0UGMvjZN507yNTHzNCzobO6RZ9grV qjZvZsGVIGDmf4f8JMwoRBG+VCl5wcDzA148gNZtHbw5/CZ+ewTUX4rFsrqjyOYYoqKK a6vNYJHdVzQ4jln44AgljmyoDsp0K7YUrYBjJZlW/pxyafWmv/v+D0HX2gbFA9co0r1A zvRPbkCTgF5CiGBtELgz2wbvVN5T5GsX95MvwoOgvZ9f7unH+8QuU6prr6JXFhvLpAta fAD2wc0pjZ61QCfOommTshygTkX0BkzppGXIz6JSjIG8xR6m1Lh738+SOU7cBnFdYFXK sgAg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=PG5RTZkgI90P7Ay2I5/CrgUMTQxy+sFcIpFu69YFgvw=; fh=hhLY7uSyFphgvNfgTE/Rpr8WPXuQtbKdkU61FSw8UXY=; b=G2l0wogNE4feUt+orBNeGlx0aHJOJxepzbUlsrrmgWXfmNq2qsR+WhBKC0HWnBiuwx plSdB4KyqesimABDSVfrR4IAXfbmUFUDEZtHLkk+I9YspVOgBKXKLh8bTpAHbyEz0GF6 4hdUM7672Pf/6jzm8DjVFILkQCjMR5taQ9zg3a2mnniQQ8csI/LRSt3ZWa6HzzXnynx9 9p8n5rDNH7QS66PZuzR4xqssc7ayqZiBXbcoX4N68FMzOsCDAscF3vHSVxTWJ6IjYFwl M3Vzd6QoPU9Uw4w0Z+ctu3fv523dBoUD5zoTdYVM6rC5BIqnmofav6XIjBcJNOAHS4BB 3QyQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=r0aMipmi; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-60892-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60892-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCXl9ErSgdzfUuEttisbGg3zKJBuglZPgL4nxcQ6/j7uHpUAu1/+3HykTIbQL5T10itaseVG0rkPaJZwrnx++z3yUnf6Te6uZ/6NPEXUwg== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id e14-20020a170906248e00b00a3bbf98fb8fsi3115722ejb.606.2024.02.11.09.45.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Feb 2024 09:45:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60892-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=r0aMipmi; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-60892-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60892-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 99C621F2286E for ; Sun, 11 Feb 2024 17:45:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 761295F48C; Sun, 11 Feb 2024 17:43:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="r0aMipmi" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 99AD45F484; Sun, 11 Feb 2024 17:43:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707673418; cv=none; b=dXeS5u/Lb738PKQRNwWBa3Gdo0+V0ywfLf65XikKWcSFGpvMukgNIaUtJdRnibFLx/d632QKX8Nq9l3z0lcs4RGmAg+ml6C1ssLT7ZrPK+L36JjqqhvYw23xdVsXF7Nb0bMzKxfOyWKhjzZ31NO6Ft7kh7dWmsEk3jh0zKfA/kg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707673418; c=relaxed/simple; bh=+y95bK88fWChXwFe8dJiZk61N/FAhsRBrO4KSZJeTWs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nZxDug7nyiKIvoYUqPROAyd7GVB8LMI76PgAcP9HkLu9nP+IKDt1ZburtclPMtU4ITIMxi8Ht1VLsNjbmg97y+cUQ1kmiV6KpPH7/tnJZvQAKemk09qAigdn4lMLl+oQY05kPmmS+eUXoYXTw96HwnHdX6+bmeVsE9OI8B9DvPE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=r0aMipmi; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id CCDEDC43399; Sun, 11 Feb 2024 17:43:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707673418; bh=+y95bK88fWChXwFe8dJiZk61N/FAhsRBrO4KSZJeTWs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=r0aMipmisV6duMkJCRpkqpdiPLxLixTLkM5cdohBgSPZ/vPLi8d6FZf3X6qPvMpAA fouKTUqKFfVdvPxi+r9AIQuHW1o3LgPtJvxK6/fbMqMe4SrEmy+IFrL5mYKSCUvAMs jm9iT2GreDxVejZblrC07OV+QihDMEFH3qz56ukAkFcgCyz29e/yKtVnXlx4nmsMEJ 3/uwd5hTaV5JCI/pt92fIzGjJeIv4otRNES5Gevdr5g2lyKfdmn2iHOjZmKpAhIZSw qIwsBzz6I4G7c2uOowuCkhv3fDNYK2nTWVkewZPEhu/GmnAoPfkTj0DJFLFhNNNQF+ lQU34WT1KbA+w== From: Jonathan Cameron To: linux-iio@vger.kernel.org, Rob Herring , Frank Rowand , linux-kernel@vger.kernel.org, Julia Lawall Cc: Peter Zijlstra , Nicolas Palix , Sumera Priyadarsini , "Rafael J . Wysocki" , Len Brown , linux-acpi@vger.kernel.org, Andy Shevchenko , Greg Kroah-Hartman , =?UTF-8?q?Nuno=20S=C3=A1?= , Jonathan Cameron Subject: [PATCH 7/8] iio: adc: ad7292: Use for_each_available_child_of_node_scoped() Date: Sun, 11 Feb 2024 17:42:35 +0000 Message-ID: <20240211174237.182947-8-jic23@kernel.org> X-Mailer: git-send-email 2.43.1 In-Reply-To: <20240211174237.182947-1-jic23@kernel.org> References: <20240211174237.182947-1-jic23@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Jonathan Cameron Avoids the need for manual cleanup of_node_put() in early exits from the loop. Signed-off-by: Jonathan Cameron --- drivers/iio/adc/ad7292.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/iio/adc/ad7292.c b/drivers/iio/adc/ad7292.c index cccacec5db6d..a9354bd1ce54 100644 --- a/drivers/iio/adc/ad7292.c +++ b/drivers/iio/adc/ad7292.c @@ -260,7 +260,6 @@ static int ad7292_probe(struct spi_device *spi) { struct ad7292_state *st; struct iio_dev *indio_dev; - struct device_node *child; bool diff_channels = false; int ret; @@ -305,12 +304,10 @@ static int ad7292_probe(struct spi_device *spi) indio_dev->modes = INDIO_DIRECT_MODE; indio_dev->info = &ad7292_info; - for_each_available_child_of_node(spi->dev.of_node, child) { + for_each_available_child_of_node_scoped(spi->dev.of_node, child) { diff_channels = of_property_read_bool(child, "diff-channels"); - if (diff_channels) { - of_node_put(child); + if (diff_channels) break; - } } if (diff_channels) { -- 2.43.1