Commit 5a233b18 authored by Vivien Didelot's avatar Vivien Didelot Committed by Greg Kroah-Hartman

hwmon: (sht15) fix bad error code

commit 6edf3c30 upstream.

When no platform data was supplied, returned error code was 0.
Signed-off-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: default avatarGuenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b67cbf2d
...@@ -515,7 +515,7 @@ static int sht15_invalidate_voltage(struct notifier_block *nb, ...@@ -515,7 +515,7 @@ static int sht15_invalidate_voltage(struct notifier_block *nb,
static int __devinit sht15_probe(struct platform_device *pdev) static int __devinit sht15_probe(struct platform_device *pdev)
{ {
int ret = 0; int ret;
struct sht15_data *data = kzalloc(sizeof(*data), GFP_KERNEL); struct sht15_data *data = kzalloc(sizeof(*data), GFP_KERNEL);
if (!data) { if (!data) {
...@@ -532,6 +532,7 @@ static int __devinit sht15_probe(struct platform_device *pdev) ...@@ -532,6 +532,7 @@ static int __devinit sht15_probe(struct platform_device *pdev)
init_waitqueue_head(&data->wait_queue); init_waitqueue_head(&data->wait_queue);
if (pdev->dev.platform_data == NULL) { if (pdev->dev.platform_data == NULL) {
ret = -EINVAL;
dev_err(&pdev->dev, "no platform data supplied"); dev_err(&pdev->dev, "no platform data supplied");
goto err_free_data; goto err_free_data;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment