From: kgene.kim@samsung.com (Kukjin Kim)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] regulators: add support max8952 regulator
Date: Sat, 04 Sep 2010 06:47:52 +0900 [thread overview]
Message-ID: <01e301cb4bb1$ac1fa240$045ee6c0$%kim@samsung.com> (raw)
In-Reply-To: <20100903094200.GC8381@sirena.org.uk>
Mark Brown wrote:
>
Hi,
Thanks for your review.
> 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.
>
Ok..will fix it.
> > - 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.
Ok..will modify as per your suggestion.
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
prev parent reply other threads:[~2010-09-03 21:47 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
2010-09-03 21:47 ` Kukjin Kim [this message]
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='01e301cb4bb1$ac1fa240$045ee6c0$%kim@samsung.com' \
--to=kgene.kim@samsung.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).