summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVivien Didelot <vivien.didelot@savoirfairelinux.com>2012-01-26 15:59:00 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-02-03 09:26:58 -0800
commit5a233b185a4a53478fe4f8ade7fdf8204b412fd8 (patch)
tree206a18ac5929323e7ab87ab58a36eafd49635c4c
parentb67cbf2deeb8198972d4d19da61ed3fc949388d6 (diff)
hwmon: (sht15) fix bad error code
commit 6edf3c30af01854c416f8654d3d5d2652470afd4 upstream. When no platform data was supplied, returned error code was 0. Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/hwmon/sht15.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/hwmon/sht15.c b/drivers/hwmon/sht15.c
index 204050720efb..740785e650bd 100644
--- a/drivers/hwmon/sht15.c
+++ b/drivers/hwmon/sht15.c
@@ -515,7 +515,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);
if (!data) {
@@ -532,6 +532,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");
goto err_free_data;
}