Input: ati_remote2 - return the error code from sysfs channel_mask store
authorVille Syrjala <syrjala@sci.fi>
Thu, 5 May 2011 03:54:27 +0000 (20:54 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Thu, 5 May 2011 15:49:38 +0000 (08:49 -0700)
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>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/input/misc/ati_remote2.c

index 9ccdb82d869a09245c80bf125a99c5fcac5cffd7..1de58e8a1b71216180808f7bd2c2e7d233f1cce7 100644 (file)
@@ -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,