From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4071C315D28 for ; Mon, 5 Jan 2026 15:31:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767627071; cv=none; b=QmCtr3mRxMfhx4b+E/6z0z/j7dHOFcwgVNR57iu9qyWvXrU48ebBKZnHT7tMoMhWTz+gEsOK4NhgCaqFsPD2DmE8TYyZIvvRs1R5ac+EkM1vMl5QCQt4SY868KFu8BnMDs04QnVbbKpLc6I7SpusFIpw1/FFURDS7va50lBHLXs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767627071; c=relaxed/simple; bh=pPsTqBNUxs5BLs6csM4iuhWO7rkYlg9n4dOuqh/oyy8=; h=Message-ID:Date:MIME-Version:From:Subject:To:References: In-Reply-To:Content-Type; b=WNJMa1J0BVwIJXcPvAIxKWClCUBx5LSUAtlRZa5nXWPAGLhZEhSmdyNcVe89Jb5CTSvAdtNQ63Qo3PMK+QvJIKiCg4ch3EgZ1D9RfXDa19n+xIkONWulkekLI7HV8JVUg9RddEcy4e1Dcm8C+XcbKBoDaQN63DZMRn99X9oXLv8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=eMvESt8x; arc=none smtp.client-ip=209.85.128.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="eMvESt8x" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-4779cc419b2so317505e9.3 for ; Mon, 05 Jan 2026 07:31:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1767627067; x=1768231867; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:organization:autocrypt :content-language:references:to:subject:reply-to:from:user-agent :mime-version:date:message-id:from:to:cc:subject:date:message-id :reply-to; bh=Kh7ER1Dmanr4y+39og58ocm6fbkiGZO7MPBDpLIvy7U=; b=eMvESt8xhARtkhDZKtJ3QvC2cd4bu+K91u9cNI7DwxHF1hVN445LFrBJEuVVqJE8g6 uCs0Wv38wTXibNDZewocsSN/wSStdhs5X49+gJIxeNGp8UB0uRsupudJ5xypHvhO1kRw pqBzpiYJ54OvDKcQuHTq9wel+c0CfbyeduDs6LvgxIjuwvTeatBSWe+DgKE2PghPVTZh FGX2wu2Q8kCeqGY5VYoORll08P/1bQi/8GRSItJaBKMHH7/yCTijR3/CH7D2+iG68BEO vUpfWNgoPcjZuOqWzLEtNOmD70SP83/FCfxSat2oJqcL1nDC+a/QI8W4pAjC9/PydVOC dM6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767627067; x=1768231867; h=content-transfer-encoding:in-reply-to:organization:autocrypt :content-language:references:to:subject:reply-to:from:user-agent :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Kh7ER1Dmanr4y+39og58ocm6fbkiGZO7MPBDpLIvy7U=; b=deXl1wT7q7TAzt4UPdHwGVq8+BudHxwsBJuScTTNl0TcbCxmUOxFK6UJLqQn3teII9 hypCcTnTKVYG601w/jDOsLdZPpnidLpx7O9YKqCcsYAJVmBic/iWDvsKhuhNXwoWw2PV YgLApyIc3t/hX5Z2rBjvVJvt35ylWvZlGeIBHGn7XWC3kHC3RKIvAdDhcQ1eVjwS4WAl 6Ec8eBf/B+i0bWgiTmETsDooviyzY5guCXGmpqy/1KYGIQEnp3UKXrRgEpBkcCol+szp 7D1ECl7rDttJhQ7V2Dd0WDHSEmshWKQoHvi2uenA+SXI2+Qo06R+dipWara3Z81TKLx4 fGMQ== X-Forwarded-Encrypted: i=1; AJvYcCVyep+Q1H04+bgbMzqBjRyUb+6f58EuI6ly+cydmybnylqLKh9SakuulALzOFML40jCCkXsoMBE5fOWncY=@vger.kernel.org X-Gm-Message-State: AOJu0YzhaPvJI3iStIuDdwoLVztVQlBcAZ6DgSeRM5nfQEO9UhvDktcG ZbiKIwerFp2rrVSBWD6lgNqFYMcvHELYTw57OWczJJt+WwnIo65y+BJw5PxWAHtY1J0= X-Gm-Gg: AY/fxX75Zml1Vruzc0bU3DliNRW6+EtC388rabVGANt0V7IlLEDUSnZ/wRuxJXgVZSB ASTdMh8TDNrNex8o43AEWzNlJahvJ+WEvuUeUMN4ChJt+b/CEhWS9ik1BvnR3xFS/9VQcICCKkM 31q+Y46g35dHOrzHBtLq1gbVIbVoBMExpUJUkoK6Go3h6MRAjjVnp0GuYhT2aWKYgzvZKAIbiZs rGXXHyMLCVteUSD6g1wBYEeVC+YuP+eV0Zu9hgBVPHjWC9GAo/cN79Ju4tjKJNJdJh6qEjuNxHf o97Ip9ttcxYRfbpscqCQRdTd9wpA27z03bfTQ2qFJBw5rVR2vA8dFJjENHZS4XG75dUJSd49J0Z TLqqMvxEsdZLZBItymY1ekb2xgov5O3JztEQRSmVi8iGJGcxc+RZLZIMYJrRJrjDb86/rZN85gs txNOKbsHajRKJf4LiuQOT3pQUxfb/spO3Qxsp4b28rb/KiUisig0EauXYH6Wk9wSg= X-Google-Smtp-Source: AGHT+IF9p+zKmR/tG/QS3dmxJEiAQ+4fOpsU5CcbeUbUUYyNOe96pzX1d6+ryPIbDaQZfZIY4GH6kw== X-Received: by 2002:a05:600c:35cb:b0:479:3a88:de60 with SMTP id 5b1f17b1804b1-47d1959e061mr604884885e9.37.1767627066781; Mon, 05 Jan 2026 07:31:06 -0800 (PST) Received: from ?IPV6:2a01:e0a:3d9:2080:d4c1:5589:eadb:1033? ([2a01:e0a:3d9:2080:d4c1:5589:eadb:1033]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-432bca52c0bsm111732f8f.26.2026.01.05.07.31.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 05 Jan 2026 07:31:06 -0800 (PST) Message-ID: <593bc508-5322-40cb-bce1-2965b31abdbd@linaro.org> Date: Mon, 5 Jan 2026 16:31:05 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Neil Armstrong Reply-To: Neil Armstrong Subject: Re: [PATCH] phy: socionext: usb2: Simplify with scoped for each OF child loop To: Krzysztof Kozlowski , Vinod Koul , Kunihiko Hayashi , Masami Hiramatsu , linux-phy@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20260102124848.64474-2-krzysztof.kozlowski@oss.qualcomm.com> Content-Language: en-US, fr Autocrypt: addr=neil.armstrong@linaro.org; keydata= xsBNBE1ZBs8BCAD78xVLsXPwV/2qQx2FaO/7mhWL0Qodw8UcQJnkrWmgTFRobtTWxuRx8WWP GTjuhvbleoQ5Cxjr+v+1ARGCH46MxFP5DwauzPekwJUD5QKZlaw/bURTLmS2id5wWi3lqVH4 BVF2WzvGyyeV1o4RTCYDnZ9VLLylJ9bneEaIs/7cjCEbipGGFlfIML3sfqnIvMAxIMZrvcl9 qPV2k+KQ7q+aXavU5W+yLNn7QtXUB530Zlk/d2ETgzQ5FLYYnUDAaRl+8JUTjc0CNOTpCeik 80TZcE6f8M76Xa6yU8VcNko94Ck7iB4vj70q76P/J7kt98hklrr85/3NU3oti3nrIHmHABEB AAHNKk5laWwgQXJtc3Ryb25nI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PMyT25Od+RC1K+iOR0F54oUJvJeq7fUzbn/KdlhA8XPGzwGRy 4zcsPWvwnXgfe5tk680fEKZVwOZKIEuJC3v+/yZpQzDvGYJvbyix0lHnrCzq43WefRHI5XTT QbM0WUIBIcGmq38+OgUsMYu4NzLu7uZFAcmp6h8g Organization: Linaro In-Reply-To: <20260102124848.64474-2-krzysztof.kozlowski@oss.qualcomm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 1/2/26 13:48, Krzysztof Kozlowski wrote: > Use scoped for-each loop when iterating over device nodes to make code a > bit simpler. > > Signed-off-by: Krzysztof Kozlowski > --- > drivers/phy/socionext/phy-uniphier-usb2.c | 28 ++++++++--------------- > 1 file changed, 10 insertions(+), 18 deletions(-) > > diff --git a/drivers/phy/socionext/phy-uniphier-usb2.c b/drivers/phy/socionext/phy-uniphier-usb2.c > index 21c201717d95..c49d432e526b 100644 > --- a/drivers/phy/socionext/phy-uniphier-usb2.c > +++ b/drivers/phy/socionext/phy-uniphier-usb2.c > @@ -106,7 +106,7 @@ static const struct phy_ops uniphier_u2phy_ops = { > static int uniphier_u2phy_probe(struct platform_device *pdev) > { > struct device *dev = &pdev->dev; > - struct device_node *parent, *child; > + struct device_node *parent; > struct uniphier_u2phy_priv *priv = NULL, *next = NULL; > struct phy_provider *phy_provider; > struct regmap *regmap; > @@ -129,34 +129,31 @@ static int uniphier_u2phy_probe(struct platform_device *pdev) > return PTR_ERR(regmap); > } > > - for_each_child_of_node(dev->of_node, child) { > + for_each_child_of_node_scoped(dev->of_node, child) { > priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); > - if (!priv) { > - ret = -ENOMEM; > - goto out_put_child; > - } > + if (!priv) > + return -ENOMEM; > + > priv->regmap = regmap; > > priv->vbus = devm_regulator_get_optional(dev, "vbus"); > if (IS_ERR(priv->vbus)) { > - if (PTR_ERR(priv->vbus) == -EPROBE_DEFER) { > - ret = PTR_ERR(priv->vbus); > - goto out_put_child; > - } > + if (PTR_ERR(priv->vbus) == -EPROBE_DEFER) > + return PTR_ERR(priv->vbus); > + > priv->vbus = NULL; > } > > priv->phy = devm_phy_create(dev, child, &uniphier_u2phy_ops); > if (IS_ERR(priv->phy)) { > dev_err(dev, "Failed to create phy\n"); > - ret = PTR_ERR(priv->phy); > - goto out_put_child; > + return PTR_ERR(priv->phy); > } > > ret = of_property_read_u32(child, "reg", &data_idx); > if (ret) { > dev_err(dev, "Failed to get reg property\n"); > - goto out_put_child; > + return ret; > } > > if (data_idx < ndatas) > @@ -174,11 +171,6 @@ static int uniphier_u2phy_probe(struct platform_device *pdev) > phy_provider = devm_of_phy_provider_register(dev, > uniphier_u2phy_xlate); > return PTR_ERR_OR_ZERO(phy_provider); > - > -out_put_child: > - of_node_put(child); > - > - return ret; > } > > static const struct uniphier_u2phy_soc_data uniphier_pro4_data[] = { Reviewed-by: Neil Armstrong Thanks, Neil