[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1437720491-28702-2-git-send-email-ptesarik@suse.com>
Date: Fri, 24 Jul 2015 08:48:08 +0200
From: Petr Tesarik <ptesarik@...e.com>
To: Johan Hovold <johan@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Petr Tesarik <ptesarik@...e.com>,
linux-usb@...r.kernel.org (open list:USB SERIAL SUBSYSTEM),
linux-kernel@...r.kernel.org (open list),
Petr Tesarik <ptesarik@...e.cz>
Subject: [PATCH 1/4] cp210x: Replace USB magic numbers with symbolic names
From: Petr Tesarik <ptesarik@...e.cz>
The request type is in fact made of three fields that already have
symbolic constants.
While I was rewriting those lines, I also converted the pre-processor
defines into an enum, so they are seen by debuggers.
Signed-off-by: Petr Tesarik <ptesarik@...e.com>
---
drivers/usb/serial/cp210x.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
index eac7cca..1bae015 100644
--- a/drivers/usb/serial/cp210x.c
+++ b/drivers/usb/serial/cp210x.c
@@ -226,10 +226,16 @@ static struct usb_serial_driver * const serial_drivers[] = {
};
/* Config request types */
-#define REQTYPE_HOST_TO_INTERFACE 0x41
-#define REQTYPE_INTERFACE_TO_HOST 0xc1
-#define REQTYPE_HOST_TO_DEVICE 0x40
-#define REQTYPE_DEVICE_TO_HOST 0xc0
+enum cp210x_request_type {
+ REQTYPE_HOST_TO_INTERFACE =
+ USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_INTERFACE,
+ REQTYPE_INTERFACE_TO_HOST =
+ USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_INTERFACE,
+ REQTYPE_HOST_TO_DEVICE =
+ USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
+ REQTYPE_DEVICE_TO_HOST =
+ USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
+};
/* Config request codes */
#define CP210X_IFC_ENABLE 0x00
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists