On Mon, Apr 24, 2017 at 08:38:47PM +0300, Sakari Ailus wrote: ... > ret won't be zero here, that was checked above. You could check for just ret > though, it'd be easier to read that way. I missed ret would have to have type long instead. How about: ret = PTR_ERR(priv->reset_gpio); if (!priv->reset_gpio) { dev_dbg("reset gpio is not assigned\n"); } else if (IS_ERR(priv->reset_gpio) && ret != -ENOSYS) { dev_dbg("error %d while getting reset gpio", ret); return ret; } -- Sakari Ailus e-mail: sakari.ailus@xxxxxx XMPP: sailus@xxxxxxxxxxxxxx