Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

phy: renesas: rcar-gen2: Simplify with scoped for each OF child loop

Use scoped for-each loop when iterating over device nodes to make code a
bit simpler.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Link: https://patch.msgid.link/20251224124407.208354-6-krzysztof.kozlowski@oss.qualcomm.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Krzysztof Kozlowski and committed by
Vinod Koul
b64b3279 175b46f3

+1 -3
+1 -3
drivers/phy/renesas/phy-rcar-gen2.c
··· 337 337 struct device *dev = &pdev->dev; 338 338 struct rcar_gen2_phy_driver *drv; 339 339 struct phy_provider *provider; 340 - struct device_node *np; 341 340 void __iomem *base; 342 341 struct clk *clk; 343 342 const struct rcar_gen2_phy_data *data; ··· 378 379 if (!drv->channels) 379 380 return -ENOMEM; 380 381 381 - for_each_child_of_node(dev->of_node, np) { 382 + for_each_child_of_node_scoped(dev->of_node, np) { 382 383 struct rcar_gen2_channel *channel = drv->channels + i; 383 384 u32 channel_num; 384 385 int error, n; ··· 390 391 error = of_property_read_u32(np, "reg", &channel_num); 391 392 if (error || channel_num >= data->num_channels) { 392 393 dev_err(dev, "Invalid \"reg\" property\n"); 393 - of_node_put(np); 394 394 return error; 395 395 } 396 396 channel->select_mask = select_mask[channel_num];