]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net: fec: Remove unneeded use of IS_ERR_VALUE() macro
authorFabio Estevam <fabio.estevam@freescale.com>
Wed, 12 Aug 2015 15:10:23 +0000 (12:10 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Dec 2015 19:31:04 +0000 (14:31 -0500)
[ Upstream commit b0c6ce24911fcb64715de9569f0f7b4f54d1d045 ]

There is no need to use the IS_ERR_VALUE() macro for checking
the return value from pm_runtime_* functions.

Just do a simple negative test instead.

The semantic patch that makes this change is available
in scripts/coccinelle/api/pm_runtime.cocci.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/freescale/fec_main.c

index de63266de16b9a3b22d32b01253e24fc7200734a..bee2765bf5bfa5ec7cf692e502b7beb5887a355e 100644 (file)
@@ -1775,7 +1775,7 @@ static int fec_enet_mdio_read(struct mii_bus *bus, int mii_id, int regnum)
        int ret = 0;
 
        ret = pm_runtime_get_sync(dev);
-       if (IS_ERR_VALUE(ret))
+       if (ret < 0)
                return ret;
 
        fep->mii_timeout = 0;
@@ -1814,7 +1814,7 @@ static int fec_enet_mdio_write(struct mii_bus *bus, int mii_id, int regnum,
        int ret = 0;
 
        ret = pm_runtime_get_sync(dev);
-       if (IS_ERR_VALUE(ret))
+       if (ret < 0)
                return ret;
 
        fep->mii_timeout = 0;
@@ -2866,7 +2866,7 @@ fec_enet_open(struct net_device *ndev)
        int ret;
 
        ret = pm_runtime_get_sync(&fep->pdev->dev);
-       if (IS_ERR_VALUE(ret))
+       if (ret < 0)
                return ret;
 
        pinctrl_pm_select_default_state(&fep->pdev->dev);