linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hwmon: (SHT15) fix bad error code
@ 2012-01-26 20:59 Vivien Didelot
  2012-01-26 21:39 ` Guenter Roeck
  0 siblings, 1 reply; 2+ messages in thread
From: Vivien Didelot @ 2012-01-26 20:59 UTC (permalink / raw)
  To: lm-sensors; +Cc: Vivien Didelot, Jean Delvare, Guenter Roeck, linux-kernel

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] hwmon: (SHT15) fix bad error code
  2012-01-26 20:59 [PATCH] hwmon: (SHT15) fix bad error code Vivien Didelot
@ 2012-01-26 21:39 ` Guenter Roeck
  0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2012-01-26 21:39 UTC (permalink / raw)
  To: Vivien Didelot; +Cc: lm-sensors, Jean Delvare, linux-kernel

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-01-26 21:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-26 20:59 [PATCH] hwmon: (SHT15) fix bad error code Vivien Didelot
2012-01-26 21:39 ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).