Date:2011-06-07 00:34:14 (12 years 9 months ago)
Author:Maarten ter Huurne
Commit:29cacc94cebb8145adcc22e22b8aca7f446f5b6e
Message:MIPS: JZ4740: USB: Fix packet read/write functions.

The read_packet() and write_packet() functions were recently converted
to use memcpy_fromio() and memcpy_toio(). However, the FIFO register
is only a single address while memcpy increases the address. Fixed by
using readsl() and writesl() instead.
Files: drivers/usb/gadget/jz4740_udc.c (2 diffs)

Change Details

drivers/usb/gadget/jz4740_udc.c
257257
258258    DEBUG("Write %d (count %d), fifo %x\n", length, count, ep->fifo);
259259
260    memcpy_toio(fifo, buf, length);
260    writesl(fifo, buf, length >> 2);
261    writesb(fifo, &buf[length - (length & 3)], length & 3);
261262
262263    return length;
263264}
...... 
277278        length = count;
278279    req->req.actual += length;
279280
280    memcpy_fromio(buf, fifo, length);
281    DEBUG("Read %d, fifo %x\n", length, ep->fifo);
282
283    readsl(fifo, buf, length >> 2);
284    readsb(fifo, &buf[length - (length & 3)], length & 3);
281285
282286    return length;
283287}

Archive Download the corresponding diff file



interactive