X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fhwmon%2Fsht15.c;h=3e3153e3011d6e67f7c6c247859eb551d0603be5;hb=5d3ecc8aa8eb3dc677d5214464a0b01e7b5e1d26;hp=fe4104c6b764e9064278bc2f02d9c27b4aff56e9;hpb=92bb062fe36132a04c6dc8b3c51c945730b05224;p=pandora-kernel.git diff --git a/drivers/hwmon/sht15.c b/drivers/hwmon/sht15.c index fe4104c6b764..3e3153e3011d 100644 --- a/drivers/hwmon/sht15.c +++ b/drivers/hwmon/sht15.c @@ -883,7 +883,7 @@ static int sht15_invalidate_voltage(struct notifier_block *nb, static int __devinit sht15_probe(struct platform_device *pdev) { - int ret = 0; + int ret; struct sht15_data *data = kzalloc(sizeof(*data), GFP_KERNEL); u8 status = 0; @@ -901,6 +901,7 @@ static int __devinit sht15_probe(struct platform_device *pdev) init_waitqueue_head(&data->wait_queue); if (pdev->dev.platform_data == NULL) { + ret = -EINVAL; dev_err(&pdev->dev, "no platform data supplied\n"); goto err_free_data; } @@ -925,7 +926,13 @@ static int __devinit sht15_probe(struct platform_device *pdev) if (voltage) data->supply_uV = voltage; - regulator_enable(data->reg); + ret = regulator_enable(data->reg); + if (ret != 0) { + dev_err(&pdev->dev, + "failed to enable regulator: %d\n", ret); + goto err_free_data; + } + /* * Setup a notifier block to update this if another device * causes the voltage to change