From patchwork Wed May 4 21:46:28 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= X-Patchwork-Id: 755432 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p44LkhtK005303 for ; Wed, 4 May 2011 21:46:43 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754245Ab1EDVqm (ORCPT ); Wed, 4 May 2011 17:46:42 -0400 Received: from filtteri1.pp.htv.fi ([213.243.153.184]:47074 "EHLO filtteri1.pp.htv.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754199Ab1EDVqm (ORCPT ); Wed, 4 May 2011 17:46:42 -0400 Received: from localhost (localhost [127.0.0.1]) by filtteri1.pp.htv.fi (Postfix) with ESMTP id 0DCAD8BBFA; Thu, 5 May 2011 00:46:41 +0300 (EEST) X-Virus-Scanned: Debian amavisd-new at pp.htv.fi Received: from smtp5.welho.com ([213.243.153.39]) by localhost (filtteri1.pp.htv.fi [213.243.153.184]) (amavisd-new, port 10024) with ESMTP id MVTAkIUIyp88; Thu, 5 May 2011 00:46:40 +0300 (EEST) Received: from mail.korsu.shacknet.nu (cs181102016.pp.htv.fi [82.181.102.16]) by smtp5.welho.com (Postfix) with ESMTP id BA9FF5BC002; Thu, 5 May 2011 00:46:40 +0300 (EEST) Received: from galatea (galatea.korsu.shacknet.nu [192.168.2.117]) by mail.korsu.shacknet.nu (Postfix) with SMTP id 20E40646B9; Thu, 5 May 2011 00:46:41 +0300 (EEST) Received: by galatea (sSMTP sendmail emulation); Thu, 05 May 2011 00:46:39 +0300 From: Ville Syrjala To: Dmitry Torokhov Cc: linux-input@vger.kernel.org, Ville Syrjala Subject: [PATCH] ati_remote2: Return the error code from sysfs channel_mask store Date: Thu, 5 May 2011 00:46:28 +0300 Message-Id: <1304545588-22990-1-git-send-email-syrjala@sci.fi> X-Mailer: git-send-email 1.7.3.4 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 04 May 2011 21:46:43 +0000 (UTC) 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 --- 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,