aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/sht15.c
diff options
context:
space:
mode:
authorVivien Didelot <vivien.didelot@savoirfairelinux.com>2012-01-26 15:59:00 -0500
committerGuenter Roeck <guenter.roeck@ericsson.com>2012-01-29 13:35:21 -0500
commit6edf3c30af01854c416f8654d3d5d2652470afd4 (patch)
tree744b870d3be8cd6bb97c200385b08748422862cb /drivers/hwmon/sht15.c
parentcba9384b3c53d1a302206f68134a6cbfbae1d686 (diff)
hwmon: (sht15) fix bad error code
When no platform data was supplied, returned error code was 0. Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Cc: stable@vger.kernel.org # 2.6.32+ Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Diffstat (limited to 'drivers/hwmon/sht15.c')
-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 6ddeae04905..91fdd1fe18b 100644
--- a/drivers/hwmon/sht15.c
+++ b/drivers/hwmon/sht15.c
@@ -883,7 +883,7 @@ static int sht15_invalidate_voltage(struct notifier_block *nb,
883 883
884static int __devinit sht15_probe(struct platform_device *pdev) 884static int __devinit sht15_probe(struct platform_device *pdev)
885{ 885{
886 int ret = 0; 886 int ret;
887 struct sht15_data *data = kzalloc(sizeof(*data), GFP_KERNEL); 887 struct sht15_data *data = kzalloc(sizeof(*data), GFP_KERNEL);
888 u8 status = 0; 888 u8 status = 0;
889 889
@@ -901,6 +901,7 @@ static int __devinit sht15_probe(struct platform_device *pdev)
901 init_waitqueue_head(&data->wait_queue); 901 init_waitqueue_head(&data->wait_queue);
902 902
903 if (pdev->dev.platform_data == NULL) { 903 if (pdev->dev.platform_data == NULL) {
904 ret = -EINVAL;
904 dev_err(&pdev->dev, "no platform data supplied\n"); 905 dev_err(&pdev->dev, "no platform data supplied\n");
905 goto err_free_data; 906 goto err_free_data;
906 } 907 }