From: broonie@opensource.wolfsonmicro.com (Mark Brown)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] regulators: add support max8952 regulator
Date: Fri, 3 Sep 2010 10:42:01 +0100 [thread overview]
Message-ID: <20100903094200.GC8381@sirena.org.uk> (raw)
In-Reply-To: <1283476524-12820-1-git-send-email-kgene.kim@samsung.com>
On Fri, Sep 03, 2010 at 10:15:24AM +0900, Kukjin Kim wrote:
> + ret2 = max8649_reg_read(info->i2c, MAX8649_CHIP_ID2);
> + if (ret2 < 0) {
> + dev_err(info->dev, "Failed to detect ID of %s:%d\n",
> + id->name, ret2);
> goto out;
> }
If the read fails you'll not set an error code when you jump to out so
the probe will report success. It might be clearer to have separate id
variables which you store the read values into if they're OK, just from
a legibility point of view.
> - dev_info(info->dev, "Detected MAX8649 (ID:%x)\n", ret);
> + dev_info(info->dev, "Detected %s (ID:%x %x)\n", id->name, ret, ret2);
> +
> + info->type = id->driver_data;
It'd be nice to check that the type that was supplied matches the ID
read from the chip in case the user got things wrong, just for
defensiveness.
next prev parent reply other threads:[~2010-09-03 9:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-03 1:15 [PATCH] regulators: add support max8952 regulator Kukjin Kim
2010-09-03 1:37 ` Kukjin Kim
2010-09-03 9:42 ` Mark Brown [this message]
2010-09-03 21:47 ` Kukjin Kim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100903094200.GC8381@sirena.org.uk \
--to=broonie@opensource.wolfsonmicro.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).