net: ethernet: ti: Use ERR_CAST instead of ERR_PTR(PTR_ERR())
authorHernán Gonzalez <hernan@vanguardiasur.com.ar>
Sun, 13 May 2018 23:33:49 +0000 (20:33 -0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 14 May 2018 20:27:59 +0000 (16:27 -0400)
Use ERR_CAST inlined function instead of ERR_PTR(PTR_ERR(...)).

drivers/net/ethernet/ti/cpts.c:567:9-16: WARNING: ERR_CAST can be used with cpts->refclk
Generated by: scripts/coccinelle/api/err_cast.cocci

Signed-off-by: Hernán Gonzalez <hernan@vanguardiasur.com.ar>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ti/cpts.c

index e7b76f6b4f67ef7ff53a22a14805d3386b789520..7842f094f2ef32f72190e2274a0e6c1e174b5fe4 100644 (file)
@@ -564,7 +564,7 @@ struct cpts *cpts_create(struct device *dev, void __iomem *regs,
        cpts->refclk = devm_clk_get(dev, "cpts");
        if (IS_ERR(cpts->refclk)) {
                dev_err(dev, "Failed to get cpts refclk\n");
-               return ERR_PTR(PTR_ERR(cpts->refclk));
+               return ERR_CAST(cpts->refclk);
        }
 
        clk_prepare(cpts->refclk);