aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/misc/ati_remote2.c
diff options
context:
space:
mode:
authorVille Syrjala <syrjala@sci.fi>2011-05-04 23:54:27 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2011-05-05 11:49:38 -0400
commit7388754e0399d341e6d02fc7394b3727cad57371 (patch)
treece88890327cbc0364840cfd46fb74bdadb3905e2 /drivers/input/misc/ati_remote2.c
parent9cc7c80b57c66d08e67f297169783d1f07288066 (diff)
Input: ati_remote2 - return the error code from sysfs channel_mask store
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>
Diffstat (limited to 'drivers/input/misc/ati_remote2.c')
-rw-r--r--drivers/input/misc/ati_remote2.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/input/misc/ati_remote2.c b/drivers/input/misc/ati_remote2.c
index 9ccdb82d869..1de58e8a1b7 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,
737 737
738 mutex_lock(&ati_remote2_mutex); 738 mutex_lock(&ati_remote2_mutex);
739 739
740 if (mask != ar2->channel_mask && !ati_remote2_setup(ar2, mask)) 740 if (mask != ar2->channel_mask) {
741 ar2->channel_mask = mask; 741 r = ati_remote2_setup(ar2, mask);
742 if (!r)
743 ar2->channel_mask = mask;
744 }
742 745
743 mutex_unlock(&ati_remote2_mutex); 746 mutex_unlock(&ati_remote2_mutex);
744 747
745 usb_autopm_put_interface(ar2->intf[0]); 748 usb_autopm_put_interface(ar2->intf[0]);
746 749
747 return count; 750 return r ? r : count;
748} 751}
749 752
750static ssize_t ati_remote2_show_mode_mask(struct device *dev, 753static ssize_t ati_remote2_show_mode_mask(struct device *dev,