From: Jerome Oufella <jerome.oufella@savoirfairelinux.com>
To: Liam Girdwood <lrg@slimlogic.co.uk>,
Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: lm-sensors <lm-sensors@lm-sensors.org>, linux-kernel@vger.kernel.org
Subject: [lm-sensors] regulator: regulator_get behaviour without
Date: Fri, 02 Apr 2010 15:47:50 +0000 [thread overview]
Message-ID: <1779783481.621270223270264.JavaMail.root@mail.savoirfairelinux.com> (raw)
In-Reply-To: <2122967437.461270223106350.JavaMail.root@mail.savoirfairelinux.com>
Hi,
Working on drivers/hwmon/sht15.c, I noticed it would return bogus temperatures in my case, where CONFIG_REGULATOR is not set.
This is due to the following section in drivers/hwmon/sht15.c:
/* If a regulator is available, query what the supply voltage actually is!*/
data->reg = regulator_get(data->dev, "vcc");
if (!IS_ERR(data->reg)) {
...
Looking at consumer.h, it appears that regulator_get() returns a pointer to its second argument when CONFIG_REGULATOR is not set.
What would be the proper way to determine if the returned value is a valid regulator ?
Would it be safe to check it against the 2nd argument ?
Regards
Jerome Oufella
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
WARNING: multiple messages have this Message-ID (diff)
From: Jerome Oufella <jerome.oufella@savoirfairelinux.com>
To: Liam Girdwood <lrg@slimlogic.co.uk>,
Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: lm-sensors <lm-sensors@lm-sensors.org>, linux-kernel@vger.kernel.org
Subject: regulator: regulator_get behaviour without CONFIG_REGULATOR set
Date: Fri, 2 Apr 2010 11:47:50 -0400 (EDT) [thread overview]
Message-ID: <1779783481.621270223270264.JavaMail.root@mail.savoirfairelinux.com> (raw)
In-Reply-To: <2122967437.461270223106350.JavaMail.root@mail.savoirfairelinux.com>
Hi,
Working on drivers/hwmon/sht15.c, I noticed it would return bogus temperatures in my case, where CONFIG_REGULATOR is not set.
This is due to the following section in drivers/hwmon/sht15.c:
/* If a regulator is available, query what the supply voltage actually is!*/
data->reg = regulator_get(data->dev, "vcc");
if (!IS_ERR(data->reg)) {
...
Looking at consumer.h, it appears that regulator_get() returns a pointer to its second argument when CONFIG_REGULATOR is not set.
What would be the proper way to determine if the returned value is a valid regulator ?
Would it be safe to check it against the 2nd argument ?
Regards
Jerome Oufella
next parent reply other threads:[~2010-04-02 15:47 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <2122967437.461270223106350.JavaMail.root@mail.savoirfairelinux.com>
2010-04-02 15:47 ` Jerome Oufella [this message]
2010-04-02 15:47 ` regulator: regulator_get behaviour without CONFIG_REGULATOR set Jerome Oufella
2010-04-02 16:00 ` [lm-sensors] regulator: regulator_get behaviour without Mark Brown
2010-04-02 16:00 ` regulator: regulator_get behaviour without CONFIG_REGULATOR set Mark Brown
2010-04-02 16:44 ` [lm-sensors] regulator: regulator_get behaviour without Jean Delvare
2010-04-02 16:44 ` [lm-sensors] regulator: regulator_get behaviour without CONFIG_REGULATOR set Jean Delvare
2010-04-02 18:51 ` [lm-sensors] regulator: regulator_get behaviour Mark Brown
2010-04-02 18:51 ` [lm-sensors] regulator: regulator_get behaviour without CONFIG_REGULATOR set Mark Brown
2010-04-02 19:30 ` [lm-sensors] regulator: regulator_get behaviour without Jean Delvare
2010-04-02 19:30 ` [lm-sensors] regulator: regulator_get behaviour without CONFIG_REGULATOR set Jean Delvare
2010-04-02 20:45 ` [lm-sensors] regulator: regulator_get behaviour Mark Brown
2010-04-02 20:45 ` [lm-sensors] regulator: regulator_get behaviour without CONFIG_REGULATOR set Mark Brown
2010-04-03 15:37 ` [lm-sensors] regulator: regulator_get behaviour without Jean Delvare
2010-04-03 15:37 ` [lm-sensors] regulator: regulator_get behaviour without CONFIG_REGULATOR set Jean Delvare
2010-04-05 13:23 ` [lm-sensors] regulator: regulator_get behaviour without Mark Brown
2010-04-05 13:23 ` [lm-sensors] regulator: regulator_get behaviour without CONFIG_REGULATOR set Mark Brown
2010-04-06 12:04 ` [lm-sensors] regulator: regulator_get behaviour without Jonathan Cameron
2010-04-06 12:04 ` [lm-sensors] regulator: regulator_get behaviour without CONFIG_REGULATOR set Jonathan Cameron
2010-04-06 15:27 ` [lm-sensors] regulator: regulator_get behaviour without Liam Girdwood
2010-04-06 15:27 ` [lm-sensors] regulator: regulator_get behaviour without CONFIG_REGULATOR set Liam Girdwood
2010-04-06 16:25 ` [lm-sensors] regulator: regulator_get behaviour without Jonathan Cameron
2010-04-06 16:25 ` [lm-sensors] regulator: regulator_get behaviour without CONFIG_REGULATOR set Jonathan Cameron
2010-04-06 18:19 ` [lm-sensors] regulator: regulator_get behaviour without Mark Brown
2010-04-06 18:19 ` [lm-sensors] regulator: regulator_get behaviour without CONFIG_REGULATOR set Mark Brown
2010-04-07 9:50 ` [lm-sensors] regulator: regulator_get behaviour without Liam Girdwood
2010-04-07 9:50 ` [lm-sensors] regulator: regulator_get behaviour without CONFIG_REGULATOR set Liam Girdwood
2010-04-07 11:24 ` [lm-sensors] regulator: regulator_get behaviour without Jonathan Cameron
2010-04-07 11:24 ` [lm-sensors] regulator: regulator_get behaviour without CONFIG_REGULATOR set Jonathan Cameron
2010-04-07 11:57 ` [lm-sensors] regulator: regulator_get behaviour without Mark Brown
2010-04-07 11:57 ` [lm-sensors] regulator: regulator_get behaviour without CONFIG_REGULATOR set Mark Brown
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=1779783481.621270223270264.JavaMail.root@mail.savoirfairelinux.com \
--to=jerome.oufella@savoirfairelinux.com \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lm-sensors@lm-sensors.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.