mirror of
https://git.yoctoproject.org/meta-ti
synced 2026-07-16 22:38:04 +00:00
646ff9d602
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> Signed-off-by: Denys Dmytriyenko <denys@ti.com>
71 lines
1.9 KiB
Diff
71 lines
1.9 KiB
Diff
From a62e9c8e391b91bd60c705748ea8ec207ef72eab Mon Sep 17 00:00:00 2001
|
|
From: Johan Hovold <jhovold@gmail.com>
|
|
Date: Thu, 10 Nov 2011 14:58:26 +0100
|
|
Subject: [PATCH 036/117] USB: move usb_translate_errors to linux/usb.h
|
|
|
|
commit 2c4d6bf295ae10ffcd84f0df6cb642598eb66603 upstream.
|
|
|
|
Move usb_translate_errors from usb core to linux/usb.h as it is meant to
|
|
be accessed from drivers.
|
|
|
|
Signed-off-by: Johan Hovold <jhovold@gmail.com>
|
|
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
|
|
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
|
---
|
|
drivers/usb/core/usb.h | 14 --------------
|
|
include/linux/usb.h | 13 +++++++++++++
|
|
2 files changed, 13 insertions(+), 14 deletions(-)
|
|
|
|
diff --git a/drivers/usb/core/usb.h b/drivers/usb/core/usb.h
|
|
index 3888778..45e8479 100644
|
|
--- a/drivers/usb/core/usb.h
|
|
+++ b/drivers/usb/core/usb.h
|
|
@@ -132,20 +132,6 @@ 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;
|
|
|
|
diff --git a/include/linux/usb.h b/include/linux/usb.h
|
|
index 7626e5a..68cdc84 100644
|
|
--- a/include/linux/usb.h
|
|
+++ b/include/linux/usb.h
|
|
@@ -1600,6 +1600,19 @@ usb_maxpacket(struct usb_device *udev, int pipe, int is_out)
|
|
|
|
/* ----------------------------------------------------------------------- */
|
|
|
|
+/* 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;
|
|
+ }
|
|
+}
|
|
+
|
|
/* Events from the usb core */
|
|
#define USB_DEVICE_ADD 0x0001
|
|
#define USB_DEVICE_REMOVE 0x0002
|
|
--
|
|
1.7.9.5
|
|
|