From: Vivien Didelot Date: Thu, 26 Jan 2012 20:59:00 +0000 (-0500) Subject: hwmon: (sht15) fix bad error code X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6edf3c30af01854c416f8654d3d5d2652470afd4;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git hwmon: (sht15) fix bad error code When no platform data was supplied, returned error code was 0. Signed-off-by: Vivien Didelot Cc: stable@vger.kernel.org # 2.6.32+ Signed-off-by: Guenter Roeck --- 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, 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; }