net: fs_enet: Simplify code
authorChristophe Jaillet <christophe.jaillet@wanadoo.fr>
Fri, 10 Feb 2017 20:17:19 +0000 (21:17 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 14 Feb 2017 03:24:31 +0000 (22:24 -0500)
There is no need to use an intermediate variable to handle an error code
in this case.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c

index 5c6426756d1169f86dcdc9f17e8176ae6fc747fa..753259091b227937b5915d34734780033f9cf05c 100644 (file)
@@ -964,11 +964,10 @@ static int fs_enet_probe(struct platform_device *ofdev)
         */
        clk = devm_clk_get(&ofdev->dev, "per");
        if (!IS_ERR(clk)) {
-               err = clk_prepare_enable(clk);
-               if (err) {
-                       ret = err;
+               ret = clk_prepare_enable(clk);
+               if (ret)
                        goto out_deregister_fixed_link;
-               }
+
                fpi->clk_per = clk;
        }