diff options
author | Vivien Didelot <vivien.didelot@savoirfairelinux.com> | 2012-01-26 15:59:00 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-02-03 09:22:15 -0800 |
commit | 9f5765fe83f37445bc31f9103511e51754807ae6 (patch) | |
tree | 66b5d120f76a37ddd66f5d5dd374c9f14d930b9e | |
parent | ccba7e5de8d358518c361aa3444ee59d4c9bd46d (diff) | |
download | lwn-9f5765fe83f37445bc31f9103511e51754807ae6.tar.gz lwn-9f5765fe83f37445bc31f9103511e51754807ae6.zip |
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.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/hwmon/sht15.c b/drivers/hwmon/sht15.c index fe4104c6b764..535792550c6d 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; } |