lkml.org 
[lkml]   [2012]   [Jan]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] hwmon: (SHT15) fix bad error code
On Thu, Jan 26, 2012 at 03:59:00PM -0500, Vivien Didelot wrote:
> When no platform data was supplied, returned error code was 0.
>
> Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
> ---
> 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 fe4104c..5357925 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;
> }
> --
> 1.7.6.5
>
Good catch. Applied.

Thanks,
Guenter



\
 
 \ /
  Last update: 2012-01-26 22:43    [W:1.263 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site