From: Wolfram Sang <w.sang@pengutronix.de>
To: linux-kernel@vger.kernel.org
Cc: Liam Girdwood <lrg@slimlogic.co.uk>, broonie@opensource.wolfsonmicro.com
Subject: regulator: adding constraints to regulator_desc?
Date: Mon, 14 Sep 2009 12:41:01 +0200 [thread overview]
Message-ID: <20090914104101.GB3164@pengutronix.de> (raw)
[-- Attachment #1: Type: text/plain, Size: 1204 bytes --]
Hi,
I have a question regarding the constraints of the regulator-framework: If I
understood correctly, there is a struct in regulator_dev which is describing
the constraints on the power-domain-level. As we also have constraints on the
regulator-level, all the regulator drivers do sanity checks in their
set_voltage()-functions. These checks differ and it is not always clear to me
if additional checks other drivers have were forgotten or intentionally omitted
for a specific driver. I also wondered about code-duplication and if it was
maybe worthwhile to simply add 'min' and 'max' members to struct regulator_desc
and let the core do sanity checks (like it does for the constraints on the
power-domain-level). Has this been considered already?
One thing which also raised my attention was the beginning of
regulator_check_voltage(). It starts with
BUG_ON(*min_uV > *max_uV);
Is it really necessary to halt the kernel? Wouldn't a big warning and -EINVAL
do like at the end of the function?
Regards,
Wolfram
--
Pengutronix e.K. | Wolfram Sang |
Industrial Linux Solutions | http://www.pengutronix.de/ |
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
next reply other threads:[~2009-09-14 10:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-14 10:41 Wolfram Sang [this message]
2009-09-14 10:57 ` Mark Brown
2009-09-14 12:15 ` Wolfram Sang
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=20090914104101.GB3164@pengutronix.de \
--to=w.sang@pengutronix.de \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lrg@slimlogic.co.uk \
/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®