]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - drivers/hwmon/sht15.c
hwmon: (sht15) Properly handle the case CONFIG_REGULATOR=n
[net-next-2.6.git] / drivers / hwmon / sht15.c
index 9a15b1af1f11cac41dd0b1a8c52c846f5cf75a2c..a610e7880fb3e5498b5d836d456ec4e25c58e278 100644 (file)
@@ -542,7 +542,12 @@ static int __devinit sht15_probe(struct platform_device *pdev)
 /* 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 */