[PATCH] ati_remote2: Return the error code from sysfs channel_mask store

Subsystems: ati_remote2 driver, input (keyboard, mouse, joystick, touchscreen) drivers, the rest

STALE5650d

2 messages, 2 authors, 2011-05-05 · open the first message on its own page

[PATCH] ati_remote2: Return the error code from sysfs channel_mask store

From: Ville Syrjala <syrjala@sci.fi>
Date: 2011-05-04 21:46:42

If the channel_mask setup fails when configuring it through sysfs,
return the error code to the caller instead of claiming success.

Signed-off-by: Ville Syrjala <syrjala@sci.fi>
---
 drivers/input/misc/ati_remote2.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/input/misc/ati_remote2.c b/drivers/input/misc/ati_remote2.c
index 0b0e9be..3877bfc 100644
--- a/drivers/input/misc/ati_remote2.c
+++ b/drivers/input/misc/ati_remote2.c
@@ -737,14 +737,17 @@ static ssize_t ati_remote2_store_channel_mask(struct device *dev,
 
 	mutex_lock(&ati_remote2_mutex);
 
-	if (mask != ar2->channel_mask && !ati_remote2_setup(ar2, mask))
-		ar2->channel_mask = mask;
+	if (mask != ar2->channel_mask) {
+		r = ati_remote2_setup(ar2, mask);
+		if (!r)
+			ar2->channel_mask = mask;
+	}
 
 	mutex_unlock(&ati_remote2_mutex);
 
 	usb_autopm_put_interface(ar2->intf[0]);
 
-	return count;
+	return r ? r : count;
 }
 
 static ssize_t ati_remote2_show_mode_mask(struct device *dev,
-- 
1.7.3.4

Re: [PATCH] ati_remote2: Return the error code from sysfs channel_mask store

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: 2011-05-05 01:32:06

On Thu, May 05, 2011 at 12:46:28AM +0300, Ville Syrjala wrote:
If the channel_mask setup fails when configuring it through sysfs,
return the error code to the caller instead of claiming success.

Signed-off-by: Ville Syrjala <syrjala@sci.fi>
Applied, thanks Ville.

-- 
Dmitry
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help