From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: MyungJoo Ham <myungjoo.ham@samsung.com>
Cc: linux-arm-kernel@lists.infradead.org,
Kukjin Kim <kgene.kim@samsung.com>,
Russell King <linux@arm.linux.org.uk>,
linux-kernel@vger.kernel.org, dg77.kim@samsung.com,
kyungmin.park@samsung.com, myungjoo.ham@gmail.com,
Ben Dooks <ben-linux@fluff.org>
Subject: Re: [PATCH 1/2] Samsung SoC ADC: use regulator (VDD for ADC).
Date: Sat, 18 Jun 2011 16:06:13 +0100 [thread overview]
Message-ID: <20110618150612.GA25163@sirena.org.uk> (raw)
In-Reply-To: <1308213003-6526-1-git-send-email-myungjoo.ham@samsung.com>
On Thu, Jun 16, 2011 at 05:30:02PM +0900, MyungJoo Ham wrote:
> + adc->vdd = regulator_get(dev, S3C_ADC_REGULATOR_NAME);
I'm not convinced that the #define for the name is terribly good style
here, especially given that you actually call it vdd in the code.
> + if (IS_ERR_OR_NULL(adc->vdd)) {
> + dev_dbg(dev, "operating without regulator %s.\n", S3C_ADC_REGULATOR_NAME);
> + adc->vdd = NULL; /* Do not control regulator */
> + }
> +
No, don't do this. Just unconditionally assume the regulator is present
if power is essential for use of the device. The regulator API will
stub out correctly if it's not in use to allow things to proceed and if
vdd is genuinely not hooked up then the driver can't function.
> + if (adc->vdd)
> + regulator_enable(adc->vdd);
You're not checking the return value here or anywhere else after the
inital get().
next prev parent reply other threads:[~2011-06-18 15:06 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-16 8:30 MyungJoo Ham
2011-06-16 8:30 ` [PATCH 2/2] Samsung SoC ADC: Channel selection for S5PV210, S5PC110, and Exynos4 MyungJoo Ham
2011-06-16 8:33 ` [PATCH] Samsung SoC ADC: register address definition for S5PV210/S5PC110/Exynos4 MyungJoo Ham
2011-06-16 8:47 ` [PATCH] Samsung SoC: header file revised to prevent declaring duplicated MyungJoo Ham
2011-06-22 9:10 ` Kukjin Kim
2011-06-18 15:06 ` Mark Brown [this message]
2011-06-20 5:16 ` [PATCH 1/2] Samsung SoC ADC: use regulator (VDD for ADC) MyungJoo Ham
2011-06-20 10:17 ` Mark Brown
2011-06-21 1:58 ` [PATCH v2 0/5] Update Samsung-SoC ADC (regulator / recent CPU support) MyungJoo Ham
2011-06-21 1:58 ` [PATCH v2 1/5] Samsung SoC ADC: use regulator (VDD for ADC) MyungJoo Ham
2011-06-21 10:43 ` Mark Brown
2011-06-22 2:40 ` MyungJoo Ham
2011-06-21 1:58 ` [PATCH v2 2/5] Samsung SoC ADC: Channel selection for S5PV210, S5PC110, and Exynos4 MyungJoo Ham
2011-06-29 13:42 ` Kukjin Kim
2011-06-30 7:50 ` MyungJoo Ham
2011-06-21 1:58 ` [PATCH v2 3/5] ARM: Exynos4: Support ADC MyungJoo Ham
2011-06-29 13:52 ` Kukjin Kim
2011-06-21 1:58 ` [PATCH v2 4/5] ARM: S5PC110/S5PV210: " MyungJoo Ham
2011-06-21 1:58 ` [PATCH v2 5/5] Samsung SoC: header file revised to prevent declaring duplicated MyungJoo Ham
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=20110618150612.GA25163@sirena.org.uk \
--to=broonie@opensource.wolfsonmicro.com \
--cc=ben-linux@fluff.org \
--cc=dg77.kim@samsung.com \
--cc=kgene.kim@samsung.com \
--cc=kyungmin.park@samsung.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=myungjoo.ham@gmail.com \
--cc=myungjoo.ham@samsung.com \
/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
all inboxes | Powered by JetHome®