From: broonie@opensource.wolfsonmicro.com (Mark Brown)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 1/2] backlight: lcd: add driver for raster-type lcd's with gpio controlled panel reset
Date: Mon, 16 Jan 2012 19:33:09 +0000 [thread overview]
Message-ID: <20120116193309.GG3514@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1326354211-27064-2-git-send-email-thomas.abraham@linaro.org>
On Thu, Jan 12, 2012 at 01:13:30PM +0530, Thomas Abraham wrote:
> + /* set regulator voltage if specified */
> + if (pd->min_uV || pd->max_uV)
> + if (regulator_set_voltage(lp->regulator,
> + pd->min_uV, pd->max_uV))
> + dev_info(lp->dev,
> + "voltage set failed\n");
> + if (regulator_enable(lp->regulator))
> + dev_info(lp->dev, "regulator enable failed\n");
You should really pay more attention to the errors here, especially for
the enable - this function does return an error code so you could
usefully tell the caller about failures.
> + /*
> + * If power to lcd and/or lcd interface is controlled using a regulator,
> + * get the handle to the regulator for later use during power switching.
> + */
> + lp->regulator = regulator_get(dev, "vcc-lcd");
> + if (IS_ERR(lp->regulator))
> + dev_info(dev, "could not find regulator\n");
It's much better style to assume that there will be a regulator in the
code and let the core worry about stubbing it out. Given that you don't
offer any support for varying the voltage dynamically I'd suggest just
removing the set_voltage() support for now - if someone adds it they can
always add additional properties and worry about handling that situation
then.
next prev parent reply other threads:[~2012-01-16 19:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-12 7:43 [PATCH v2 0/2] Add lcd driver for panels with gpio controlled panel reset Thomas Abraham
2012-01-12 7:43 ` [PATCH v2 1/2] backlight: lcd: add driver for raster-type lcd's " Thomas Abraham
2012-01-16 19:33 ` Mark Brown [this message]
2012-01-12 7:43 ` [PATCH v2 2/2] ARM: Exynos: Use lcd power control driver for lcd panel Thomas Abraham
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=20120116193309.GG3514@opensource.wolfsonmicro.com \
--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).