[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1779783481.621270223270264.JavaMail.root@mail.savoirfairelinux.com>
Date: Fri, 2 Apr 2010 11:47:50 -0400 (EDT)
From: Jerome Oufella <jerome.oufella@...oirfairelinux.com>
To: Liam Girdwood <lrg@...mlogic.co.uk>,
Mark Brown <broonie@...nsource.wolfsonmicro.com>
Cc: lm-sensors <lm-sensors@...sensors.org>,
linux-kernel@...r.kernel.org
Subject: regulator: regulator_get behaviour without CONFIG_REGULATOR set
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists