]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
hwmon: (sht15) fix bad error code
authorVivien Didelot <vivien.didelot@savoirfairelinux.com>
Thu, 26 Jan 2012 20:59:00 +0000 (15:59 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 3 Feb 2012 17:19:02 +0000 (09:19 -0800)
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>
drivers/hwmon/sht15.c

index cf4330b352ef2c9b439b1685c5d94ad29eba31f4..9594cdb1cd0fd1f638a2f9c1ea584552cedbbfa1 100644 (file)
@@ -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;
        }