net: gianfar: no need to check parameter being != NULL for of_node_put
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Thu, 7 Aug 2014 19:20:12 +0000 (21:20 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 7 Aug 2014 23:02:57 +0000 (16:02 -0700)
of_node_put is a noop when being called with NULL.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/gianfar.c

index a6cf40e62f3a9c531f2997c34590fbe89d0ddc80..6b0c4775cd0db33d51655b501f3c962b10458798 100644 (file)
@@ -1435,10 +1435,8 @@ register_fail:
        unmap_group_regs(priv);
        gfar_free_rx_queues(priv);
        gfar_free_tx_queues(priv);
-       if (priv->phy_node)
-               of_node_put(priv->phy_node);
-       if (priv->tbi_node)
-               of_node_put(priv->tbi_node);
+       of_node_put(priv->phy_node);
+       of_node_put(priv->tbi_node);
        free_gfar_dev(priv);
        return err;
 }
@@ -1447,10 +1445,8 @@ static int gfar_remove(struct platform_device *ofdev)
 {
        struct gfar_private *priv = platform_get_drvdata(ofdev);
 
-       if (priv->phy_node)
-               of_node_put(priv->phy_node);
-       if (priv->tbi_node)
-               of_node_put(priv->tbi_node);
+       of_node_put(priv->phy_node);
+       of_node_put(priv->tbi_node);
 
        unregister_netdev(priv->ndev);
        unmap_group_regs(priv);