of_node_put has taken the null pinter check into account. So it is
safe to remove the duplicated check before of_node_put.
Signed-off-by: zhong jiang <[email protected]>
---
drivers/net/ethernet/freescale/fec_main.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index 2708297..67d6c9d 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -2055,8 +2055,7 @@ static int fec_enet_mii_init(struct platform_device *pdev)
node = of_get_child_by_name(pdev->dev.of_node, "mdio");
err = of_mdiobus_register(fep->mii_bus, node);
- if (node)
- of_node_put(node);
+ of_node_put(node);
if (err)
goto err_out_free_mdiobus;
--
1.7.12.4
On 09/16/2018 04:13 PM, zhong jiang wrote:
> of_node_put has taken the null pinter check into account. So it is
> safe to remove the duplicated check before of_node_put.
>
> Signed-off-by: zhong jiang <[email protected]>
typo in the commit message, s/pinter/pointer/
Other than that please feel free to add my
Reviewed-by: Vladimir Zapolskiy <[email protected]>
From: zhong jiang <[email protected]> Sent: 2018??9??16?? 21:14
> of_node_put has taken the null pinter check into account. So it is safe to
> remove the duplicated check before of_node_put.
>
> Signed-off-by: zhong jiang <[email protected]>
Acked-by: Fugang Duan <[email protected]>
> ---
> drivers/net/ethernet/freescale/fec_main.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/freescale/fec_main.c
> b/drivers/net/ethernet/freescale/fec_main.c
> index 2708297..67d6c9d 100644
> --- a/drivers/net/ethernet/freescale/fec_main.c
> +++ b/drivers/net/ethernet/freescale/fec_main.c
> @@ -2055,8 +2055,7 @@ static int fec_enet_mii_init(struct
> platform_device *pdev)
>
> node = of_get_child_by_name(pdev->dev.of_node, "mdio");
> err = of_mdiobus_register(fep->mii_bus, node);
> - if (node)
> - of_node_put(node);
> + of_node_put(node);
> if (err)
> goto err_out_free_mdiobus;
>
> --
> 1.7.12.4
From: zhong jiang <[email protected]>
Date: Sun, 16 Sep 2018 21:13:42 +0800
> of_node_put has taken the null pinter check into account. So it is
> safe to remove the duplicated check before of_node_put.
>
> Signed-off-by: zhong jiang <[email protected]>
Applied.