On Mon, May 24, 2004 at 05:42:54PM -0400, nardelli wrote:
Nah, this is good enough. I've tweaked the patch a bit to keep from
creating a big structure on the stack, and reduced the copy port logic
to something a bit more readable and applied this version. I'll send it
off to Linus in a day or so.
Thanks a lot for your work on this.
greg k-h
+#define COPY_PORT(dest, src) \
+ dest->read_urb = src->read_urb; \
+ dest->bulk_in_endpointAddress = src->bulk_in_endpointAddress; \
+ dest->bulk_in_buffer = src->bulk_in_buffer; \
+ dest->interrupt_in_urb = src->interrupt_in_urb; \
+ dest->interrupt_in_endpointAddress = src->interrupt_in_endpointAddress; \
+ dest->interrupt_in_buffer = src->interrupt_in_buffer;
+
+ swap_port = kmalloc(sizeof(*swap_port), GFP_KERNEL);
+ if (!swap_port)
+ return -ENOMEM;
+ COPY_PORT(swap_port, serial->port[0]);
+ COPY_PORT(serial->port[0], serial->port[1]);
+ COPY_PORT(serial->port[1], swap_port);
+ kfree(swap_port);
return 0;
}
-