[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20150114.164732.1058665183210615359.davem@davemloft.net>
Date: Wed, 14 Jan 2015 16:47:32 -0500 (EST)
From: David Miller <davem@...emloft.net>
To: Zubair.Kakakhel@...tec.com
Cc: devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
netdev@...r.kernel.org, s.hauer@...gutronix.de,
sergei.shtylyov@...entembedded.com
Subject: Re: [PATCH_V4] dm9000: Add regulator and reset support to dm9000
From: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@...tec.com>
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 netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists