[alsa-devel] [PATCH] ASoC: cs42xx8: Check return value of regmap_read and report correct chipid value

Mark Brown broonie at kernel.org
Thu Apr 3 23:33:39 CEST 2014


On Thu, Apr 03, 2014 at 11:33:15PM +0800, Nicolin Chen wrote:
> On Thu, Apr 03, 2014 at 03:53:36PM +0800, Axel Lin wrote:

> > +	ret = regmap_read(cs42xx8->regmap, CS42XX8_CHIPID, &val);
> > +	if (ret < 0) {
> >  		dev_err(dev, "failed to get device ID: %x", val);

> %d and ret would be better here since val won't be useful in this case.

Yes, they would - val won't have anything in particular in it if the I/O
fails.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20140403/cab1f6e8/attachment.sig>


More information about the Alsa-devel mailing list