drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:2587:9-16: WARNING: ERR_CAST can be used with gpio Use ERR_CAST inlined function instead of ERR_PTR(PTR_ERR(...)) Generated by: scripts/coccinelle/api/err_cast.cocci CC: Paul Burton <paul.burton@xxxxxxxxxx> Signed-off-by: Fengguang Wu <fengguang.wu@xxxxxxxxx> --- pch_gbe_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c +++ b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c @@ -2584,7 +2584,7 @@ pch_gbe_get_priv(struct pci_dev *pdev, c if (!IS_ERR(gpio)) pdata->phy_reset_gpio = gpio; else if (PTR_ERR(gpio) != -ENOENT) - return ERR_PTR(PTR_ERR(gpio)); + return ERR_CAST(gpio); return pdata; }