diff options
author | Oliver Neukum <oneukum@suse.de> | 2007-03-19 08:58:29 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-04-27 16:28:36 -0400 |
commit | 325b70c233396f0cfe15012682a5080bf8040901 (patch) | |
tree | 67d2b5db059ebf7c866c6af42b8eca0b9c747b29 /drivers | |
parent | 1b55fa2d430d6c708d3e5efbc6134be4a0c32b15 (diff) |
USB: fix endianness in mos7720
there's code unclean w.r.t. endianness in the mos7720 driver.
Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/serial/mos7720.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/usb/serial/mos7720.c b/drivers/usb/serial/mos7720.c index 6ba87e6e28c3..b563e2ad8728 100644 --- a/drivers/usb/serial/mos7720.c +++ b/drivers/usb/serial/mos7720.c | |||
@@ -103,11 +103,9 @@ static void mos7720_interrupt_callback(struct urb *urb) | |||
103 | { | 103 | { |
104 | int result; | 104 | int result; |
105 | int length; | 105 | int length; |
106 | __u32 *data; | 106 | __u8 *data; |
107 | unsigned int status; | ||
108 | __u8 sp1; | 107 | __u8 sp1; |
109 | __u8 sp2; | 108 | __u8 sp2; |
110 | __u8 st; | ||
111 | 109 | ||
112 | dbg("%s"," : Entering\n"); | 110 | dbg("%s"," : Entering\n"); |
113 | 111 | ||
@@ -141,18 +139,19 @@ static void mos7720_interrupt_callback(struct urb *urb) | |||
141 | * Byte 2 IIR Port 2 (port.number is 1) | 139 | * Byte 2 IIR Port 2 (port.number is 1) |
142 | * Byte 3 -------------- | 140 | * Byte 3 -------------- |
143 | * Byte 4 FIFO status for both */ | 141 | * Byte 4 FIFO status for both */ |
144 | if (length && length > 4) { | 142 | |
143 | /* the above description is inverted | ||
144 | * oneukum 2007-03-14 */ | ||
145 | |||
146 | if (unlikely(length != 4)) { | ||
145 | dbg("Wrong data !!!"); | 147 | dbg("Wrong data !!!"); |
146 | return; | 148 | return; |
147 | } | 149 | } |
148 | 150 | ||
149 | status = *data; | 151 | sp1 = data[3]; |
150 | 152 | sp2 = data[2]; | |
151 | sp1 = (status & 0xff000000)>>24; | ||
152 | sp2 = (status & 0x00ff0000)>>16; | ||
153 | st = status & 0x000000ff; | ||
154 | 153 | ||
155 | if ((sp1 & 0x01) || (sp2 & 0x01)) { | 154 | if ((sp1 | sp2) & 0x01) { |
156 | /* No Interrupt Pending in both the ports */ | 155 | /* No Interrupt Pending in both the ports */ |
157 | dbg("No Interrupt !!!"); | 156 | dbg("No Interrupt !!!"); |
158 | } else { | 157 | } else { |