mirror of
https://github.com/torvalds/linux.git
synced 2026-09-23 05:04:02 +02:00
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>
This commit is contained in:
parent
175b46f31f
commit
b64b32791f
|
|
@ -337,7 +337,6 @@ static int rcar_gen2_phy_probe(struct platform_device *pdev)
|
||||||
struct device *dev = &pdev->dev;
|
struct device *dev = &pdev->dev;
|
||||||
struct rcar_gen2_phy_driver *drv;
|
struct rcar_gen2_phy_driver *drv;
|
||||||
struct phy_provider *provider;
|
struct phy_provider *provider;
|
||||||
struct device_node *np;
|
|
||||||
void __iomem *base;
|
void __iomem *base;
|
||||||
struct clk *clk;
|
struct clk *clk;
|
||||||
const struct rcar_gen2_phy_data *data;
|
const struct rcar_gen2_phy_data *data;
|
||||||
|
|
@ -379,7 +378,7 @@ static int rcar_gen2_phy_probe(struct platform_device *pdev)
|
||||||
if (!drv->channels)
|
if (!drv->channels)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
for_each_child_of_node(dev->of_node, np) {
|
for_each_child_of_node_scoped(dev->of_node, np) {
|
||||||
struct rcar_gen2_channel *channel = drv->channels + i;
|
struct rcar_gen2_channel *channel = drv->channels + i;
|
||||||
u32 channel_num;
|
u32 channel_num;
|
||||||
int error, n;
|
int error, n;
|
||||||
|
|
@ -391,7 +390,6 @@ static int rcar_gen2_phy_probe(struct platform_device *pdev)
|
||||||
error = of_property_read_u32(np, "reg", &channel_num);
|
error = of_property_read_u32(np, "reg", &channel_num);
|
||||||
if (error || channel_num >= data->num_channels) {
|
if (error || channel_num >= data->num_channels) {
|
||||||
dev_err(dev, "Invalid \"reg\" property\n");
|
dev_err(dev, "Invalid \"reg\" property\n");
|
||||||
of_node_put(np);
|
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
channel->select_mask = select_mask[channel_num];
|
channel->select_mask = select_mask[channel_num];
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user