Prev: [086/139] x86-64, rwsem: 64-bit xadd rwsem implementation
Next: [109/139] ecryptfs: fix error code for missing xattrs in lower fs
From: Greg KH on 22 Apr 2010 16:20 2.6.33-stable review patch. If anyone has any objections, please let us know. ------------------ From: Jean Delvare <khali(a)linux-fr.org> commit c7a78d2c2e2537fd24903e966f34aae50319d587 upstream. When CONFIG_REGULATOR isn't set, regulator_get_voltage() returns 0. Properly handle this case by not trusting the value. Reported-by: Jerome Oufella <jerome.oufella(a)savoirfairelinux.com> Signed-off-by: Jean Delvare <khali(a)linux-fr.org> Cc: Jonathan Cameron <jic23(a)cam.ac.uk> Acked-by: Mark Brown <broonie(a)opensource.wolfsonmicro.com> Signed-off-by: Greg Kroah-Hartman <gregkh(a)suse.de> --- drivers/hwmon/sht15.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) --- a/drivers/hwmon/sht15.c +++ b/drivers/hwmon/sht15.c @@ -541,7 +541,12 @@ static int __devinit sht15_probe(struct /* If a regulator is available, query what the supply voltage actually is!*/ data->reg = regulator_get(data->dev, "vcc"); if (!IS_ERR(data->reg)) { - data->supply_uV = regulator_get_voltage(data->reg); + int voltage; + + voltage = regulator_get_voltage(data->reg); + if (voltage) + data->supply_uV = voltage; + regulator_enable(data->reg); /* setup a notifier block to update this if another device * causes the voltage to change */ -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ |