From: Vivien Didelot <[email protected]>

When no platform data was supplied, returned error code was 0.

Signed-off-by: Vivien Didelot <[email protected]>
Cc: [email protected] # 2.6.32+
Signed-off-by: Guenter Roeck <[email protected]>
---
Backport to 2.6.32.

Upstream commit: 6edf3c30af01854c416f8654d3d5d2652470afd4

 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 2040507..740785e 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;
        }
-- 
1.7.5.4

--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to