From patchwork Thu Aug 25 14:06:50 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: axel lin X-Patchwork-Id: 1096472 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p7PE8V88016670 for ; Thu, 25 Aug 2011 14:08:31 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751164Ab1HYOHH (ORCPT ); Thu, 25 Aug 2011 10:07:07 -0400 Received: from mail-ew0-f46.google.com ([209.85.215.46]:60927 "EHLO mail-ew0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751055Ab1HYOHE (ORCPT ); Thu, 25 Aug 2011 10:07:04 -0400 Received: by ewy4 with SMTP id 4so951442ewy.19 for ; Thu, 25 Aug 2011 07:07:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=subject:from:to:cc:content-type:date:message-id:mime-version :x-mailer:content-transfer-encoding; bh=PfdNhNdm9fPa7jgRZV5F9y5onskyUqRkgvE8qAYDz/I=; b=V0RonkJPyWIWZTLnYYdoksbtLPT7s6bfG2lwKf72yN/VIqD0usL9wP2A3G2D57YyTj cv8GJKD/uYRAOGiDctVhPFzrohFkKLqtOBEK9/HqFkMclkwOXQKOUeWAMAknereNBsjK s/Pa2CqmGoR3u/kmi7nk8aBh6IDgIW7tH1XEg= Received: by 10.14.11.200 with SMTP id 48mr2465515eex.173.1314281223536; Thu, 25 Aug 2011 07:07:03 -0700 (PDT) Received: from [218.172.235.137] (218-172-235-137.dynamic.hinet.net [218.172.235.137]) by mx.google.com with ESMTPS id r1sm400525eef.26.2011.08.25.07.06.59 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 25 Aug 2011 07:07:02 -0700 (PDT) Subject: [PATCH] Input: cm109 - fix checking return value of usb_control_msg From: Axel Lin To: linux-kernel@vger.kernel.org Cc: "Alfred E. Heggestad" , Dmitry Torokhov , linux-input@vger.kernel.org Date: Thu, 25 Aug 2011 22:06:50 +0800 Message-ID: <1314281210.5915.1.camel@phoenix> Mime-Version: 1.0 X-Mailer: Evolution 2.32.2 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]); Thu, 25 Aug 2011 14:08:48 +0000 (UTC) If successful, usb_control_msg returns the number of bytes transferred, otherwise a negative error number. Signed-off-by: Axel Lin --- drivers/input/misc/cm109.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/input/misc/cm109.c b/drivers/input/misc/cm109.c index b09c7d1..b741338 100644 --- a/drivers/input/misc/cm109.c +++ b/drivers/input/misc/cm109.c @@ -475,7 +475,7 @@ static void cm109_toggle_buzzer_sync(struct cm109_dev *dev, int on) le16_to_cpu(dev->ctl_req->wIndex), dev->ctl_data, USB_PKT_LEN, USB_CTRL_SET_TIMEOUT); - if (error && error != EINTR) + if ((error < 0) && (error != -EINTR)) err("%s: usb_control_msg() failed %d", __func__, error); }