From patchwork Tue Jun 8 14:12:03 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oliver Neukum X-Patchwork-Id: 104965 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o58EBr51011910 for ; Tue, 8 Jun 2010 14:11:53 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754928Ab0FHOLu (ORCPT ); Tue, 8 Jun 2010 10:11:50 -0400 Received: from smtp-out002.kontent.com ([81.88.40.216]:36553 "EHLO smtp-out002.kontent.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754530Ab0FHOLu convert rfc822-to-8bit (ORCPT ); Tue, 8 Jun 2010 10:11:50 -0400 Received: from vanamonde.localnet (p54BE4C96.dip.t-dialin.net [84.190.76.150]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: neukum_org@smtp-out002.kontent.com) by smtp-out002.kontent.com (Postfix) with ESMTPSA id 863E0580B082; Tue, 8 Jun 2010 16:11:48 +0200 (CEST) From: Oliver Neukum To: Dmitry Torokhov Subject: Re: [PATCH 2/3] usbtouchscreen: Implement runtime power management Date: Tue, 8 Jun 2010 16:12:03 +0200 User-Agent: KMail/1.12.4 (Linux/2.6.35-rc2-0.1-default+; KDE/4.3.5; x86_64; ; ) Cc: Alan Stern , linux-input@vger.kernel.org, linux-usb@vger.kernel.org, Daniel Ritz References: <201006072247.33068.oliver@neukum.org> <20100608083751.GA27348@core.coreip.homeip.net> In-Reply-To: <20100608083751.GA27348@core.coreip.homeip.net> MIME-Version: 1.0 Message-Id: <201006081612.03253.oliver@neukum.org> 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.3 (demeter.kernel.org [140.211.167.41]); Tue, 08 Jun 2010 14:11:53 +0000 (UTC) diff --git a/drivers/usb/core/usb.h b/drivers/usb/core/usb.h index cd88220..b070549 100644 --- a/drivers/usb/core/usb.h +++ b/drivers/usb/core/usb.h @@ -124,6 +124,18 @@ static inline int is_usb_device_driver(struct device_driver *drv) for_devices; } +/* translate USB error codes to codes user space understands */ +static inline int usb_translate_errors(int error_code) +{ + switch (error_code) { + case 0: + case -ENOMEM: + case -ENODEV: + return error_code; + default: + return -EIO; + } +} /* for labeling diagnostics */ extern const char *usbcore_name;