Re: [PATCH_V4] dm9000: Add regulator and reset support to dm9000

From: David Miller
Date: Wed Jan 14 2015 - 16:47:39 EST


From: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@xxxxxxxxxx>
Date: Wed, 14 Jan 2015 10:36:17 +0000

> + power = devm_regulator_get(dev, "vcc");
> + if (PTR_ERR(power) == -EPROBE_DEFER)
> + return -EPROBE_DEFER;
> + if (IS_ERR(power)) {
> + dev_dbg(dev, "no regulator provided\n");

I know it may seem silly, but to me it is more logical to always
guard PTR_ERR() uses with IS_ERR().

Therefore could you please restructure this as:

if (IS_ERR(power)) {
if (PTR_ERR(power) == -EPROBE_DEFER)
return -EPROBE_DEFER;
else
dev_dbg(dev, "no regulator provided\n");
} else {

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/