Skip to content

Commit

Permalink
USB: g_file_storage: fix bug in DMA buffer handling
Browse files Browse the repository at this point in the history
This patch (as963) fixes a recently-introduced bug.  The gadget
conversion removing DMA-mapped buffer allocation did not remove quite
enough code from the g_file_storage driver; DMA pointers were being
set to 0.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Alan Stern authored and Greg Kroah-Hartman committed Aug 22, 2007
1 parent 013d27f commit d1a94f0
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions drivers/usb/gadget/file_storage.c
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,6 @@ enum fsg_buffer_state {

struct fsg_buffhd {
void *buf;
dma_addr_t dma;
enum fsg_buffer_state state;
struct fsg_buffhd *next;

Expand Down Expand Up @@ -2612,7 +2611,6 @@ static int send_status(struct fsg_dev *fsg)

fsg->intr_buffhd = bh; // Point to the right buffhd
fsg->intreq->buf = bh->inreq->buf;
fsg->intreq->dma = bh->inreq->dma;
fsg->intreq->context = bh;
start_transfer(fsg, fsg->intr_in, fsg->intreq,
&fsg->intreq_busy, &bh->state);
Expand Down Expand Up @@ -3201,7 +3199,6 @@ static int do_set_interface(struct fsg_dev *fsg, int altsetting)
if ((rc = alloc_request(fsg, fsg->bulk_out, &bh->outreq)) != 0)
goto reset;
bh->inreq->buf = bh->outreq->buf = bh->buf;
bh->inreq->dma = bh->outreq->dma = bh->dma;
bh->inreq->context = bh->outreq->context = bh;
bh->inreq->complete = bulk_in_complete;
bh->outreq->complete = bulk_out_complete;
Expand Down

0 comments on commit d1a94f0

Please sign in to comment.