mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-09-21 20:22:13 +08:00
net: mv643xx_eth: Simplify with scoped for each OF child loop
Use scoped for_each_available_child_of_node_scoped() when iterating over device nodes to make code a bit simpler. Reviewed-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
parent
4078513fc8
commit
3a3eea209e
@ -2802,7 +2802,7 @@ port_err:
|
|||||||
static int mv643xx_eth_shared_of_probe(struct platform_device *pdev)
|
static int mv643xx_eth_shared_of_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct mv643xx_eth_shared_platform_data *pd;
|
struct mv643xx_eth_shared_platform_data *pd;
|
||||||
struct device_node *pnp, *np = pdev->dev.of_node;
|
struct device_node *np = pdev->dev.of_node;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
/* bail out if not registered from DT */
|
/* bail out if not registered from DT */
|
||||||
@ -2816,10 +2816,9 @@ static int mv643xx_eth_shared_of_probe(struct platform_device *pdev)
|
|||||||
|
|
||||||
mv643xx_eth_property(np, "tx-checksum-limit", pd->tx_csum_limit);
|
mv643xx_eth_property(np, "tx-checksum-limit", pd->tx_csum_limit);
|
||||||
|
|
||||||
for_each_available_child_of_node(np, pnp) {
|
for_each_available_child_of_node_scoped(np, pnp) {
|
||||||
ret = mv643xx_eth_shared_of_add_port(pdev, pnp);
|
ret = mv643xx_eth_shared_of_add_port(pdev, pnp);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
of_node_put(pnp);
|
|
||||||
mv643xx_eth_shared_of_remove();
|
mv643xx_eth_shared_of_remove();
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user