Re: [PATCH 2/2] net: fs_enet: Simplify code

2017-02-13 Thread David Miller
From: Christophe JAILLET 
Date: Fri, 10 Feb 2017 21:17:19 +0100

> There is no need to use an intermediate variable to handle an error code
> in this case.
> 
> Signed-off-by: Christophe JAILLET 

Applied.


[PATCH 2/2] net: fs_enet: Simplify code

2017-02-10 Thread Christophe JAILLET
There is no need to use an intermediate variable to handle an error code
in this case.

Signed-off-by: Christophe JAILLET 
---
I think that the remaining use of 'err' a few lines above could also be
dropped. However, it could change the return value (i.e. propagation of the
error returned by 'of_phy_register_fixed_link' instead of -ENODEV) and I'm
unsure it would be correct. So I leave it as-is.
---
 drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c | 7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c 
b/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c
index 5c6426756d11..753259091b22 100644
--- a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c
+++ b/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c
@@ -964,11 +964,10 @@ static int fs_enet_probe(struct platform_device *ofdev)
 */
clk = devm_clk_get(>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;
}
 
-- 
2.9.3