linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] input: trackpoint: return proper error value
@ 2011-01-20 14:45 Davidlohr Bueso
  2011-01-21  7:36 ` Dmitry Torokhov
  0 siblings, 1 reply; 2+ messages in thread
From: Davidlohr Bueso @ 2011-01-20 14:45 UTC (permalink / raw)
  To: Dmitry Torokhov, LKML; +Cc: linux-serial

From: Davidlohr Bueso <dave@gnu.org>

If sysfs_create_group() returns an error, we should return it in trackpoint_detect(), instead of -1.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
---
 drivers/input/mouse/trackpoint.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/input/mouse/trackpoint.c b/drivers/input/mouse/trackpoint.c
index 54b2fa8..e8b7c3f 100644
--- a/drivers/input/mouse/trackpoint.c
+++ b/drivers/input/mouse/trackpoint.c
@@ -324,7 +324,7 @@ int trackpoint_detect(struct psmouse *psmouse, bool set_properties)
 			error);
 		kfree(psmouse->private);
 		psmouse->private = NULL;
-		return -1;
+		return error;
 	}
 
 	printk(KERN_INFO "IBM TrackPoint firmware: 0x%02x, buttons: %d/%d\n",
-- 
1.7.1




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

* Re: [PATCH] input: trackpoint: return proper error value
  2011-01-20 14:45 [PATCH] input: trackpoint: return proper error value Davidlohr Bueso
@ 2011-01-21  7:36 ` Dmitry Torokhov
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2011-01-21  7:36 UTC (permalink / raw)
  To: Davidlohr Bueso; +Cc: LKML, linux-serial

On Thu, Jan 20, 2011 at 11:45:30AM -0300, Davidlohr Bueso wrote:
> From: Davidlohr Bueso <dave@gnu.org>
> 
> If sysfs_create_group() returns an error, we should return it in trackpoint_detect(), instead of -1.
> 
> Signed-off-by: Davidlohr Bueso <dave@gnu.org>
> ---
>  drivers/input/mouse/trackpoint.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/input/mouse/trackpoint.c b/drivers/input/mouse/trackpoint.c
> index 54b2fa8..e8b7c3f 100644
> --- a/drivers/input/mouse/trackpoint.c
> +++ b/drivers/input/mouse/trackpoint.c
> @@ -324,7 +324,7 @@ int trackpoint_detect(struct psmouse *psmouse, bool set_properties)
>  			error);
>  		kfree(psmouse->private);
>  		psmouse->private = NULL;
> -		return -1;
> +		return error;

This is not the only place where we return -1 in place of proper error
code in that driver. Care to update all of them?

Thanks.

-- 
Dmitry

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

end of thread, other threads:[~2011-01-21  7:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-20 14:45 [PATCH] input: trackpoint: return proper error value Davidlohr Bueso
2011-01-21  7:36 ` Dmitry Torokhov

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).