From 15a06ec55ae999398c0f056257beeb7a1812e6ba Mon Sep 17 00:00:00 2001 From: David Brownell Date: Fri, 12 Oct 2007 14:24:51 -0700 Subject: [PATCH] rest of dma_controller.private_data updates Finish getting rid of dma_controller.private data, fixing a bug related to the previous DaVinci private_data fix. Also get rid of a compiler warning in the 2430 dma code. Signed-off-by: David Brownell --- drivers/usb/musb/musb_core.c | 2 +- drivers/usb/musb/musb_dma.h | 2 -- drivers/usb/musb/musbhsdma.c | 11 +++++------ drivers/usb/musb/tusb6010_omap.c | 1 - 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index dc934dcea8c..ac9ce46097e 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c @@ -1849,7 +1849,7 @@ static void musb_free(struct musb *musb) if (is_dma_capable() && musb->dma_controller) { struct dma_controller *c = musb->dma_controller; - (void) c->stop(c->private_data); + (void) c->stop(c); dma_controller_destroy(c); } diff --git a/drivers/usb/musb/musb_dma.h b/drivers/usb/musb/musb_dma.h index 7a9fc89973f..0a2c4e3602c 100644 --- a/drivers/usb/musb/musb_dma.h +++ b/drivers/usb/musb/musb_dma.h @@ -136,7 +136,6 @@ dma_channel_status(struct dma_channel *c) /** * struct dma_controller - A DMA Controller. - * @private_data: controller-private data; * @start: call this to start a DMA controller; * return 0 on success, else negative errno * @stop: call this to stop a DMA controller @@ -149,7 +148,6 @@ dma_channel_status(struct dma_channel *c) * Controllers manage dma channels. */ struct dma_controller { - void *private_data; int (*start)(struct dma_controller *); int (*stop)(struct dma_controller *); struct dma_channel *(*channel_alloc)(struct dma_controller *, diff --git a/drivers/usb/musb/musbhsdma.c b/drivers/usb/musb/musbhsdma.c index 589ca80a64e..97fd14659d8 100644 --- a/drivers/usb/musb/musbhsdma.c +++ b/drivers/usb/musb/musbhsdma.c @@ -326,6 +326,8 @@ static irqreturn_t dma_controller_irq(int irq, void *private_data) pImplChannel->Channel.status = MUSB_DMA_STATUS_BUS_ABORT; else { + u8 devctl; + dwAddress = musb_readl(mbase, MUSB_HSDMA_CHANNEL_OFFSET( bChannel, @@ -341,8 +343,7 @@ static irqreturn_t dma_controller_irq(int irq, void *private_data) < pImplChannel->len) ? "=> reconfig 0": "=> complete"); - u8 devctl = musb_readb(mbase, - MUSB_DEVCTL); + devctl = musb_readb(mbase, MUSB_DEVCTL); pChannel->status = MUSB_DMA_STATUS_FREE; @@ -376,9 +377,9 @@ done: void dma_controller_destroy(struct dma_controller *c) { - struct musb_dma_controller *controller = - (struct musb_dma_controller *) c->private_data; + struct musb_dma_controller *controller; + controller = container_of(c, struct musb_dma_controller, Controller); if (!controller) return; @@ -386,7 +387,6 @@ void dma_controller_destroy(struct dma_controller *c) free_irq(controller->irq, c); kfree(controller); - c->private_data = NULL; } struct dma_controller *__init @@ -410,7 +410,6 @@ dma_controller_create(struct musb *musb, void __iomem *pCoreBase) controller->pDmaPrivate = musb; controller->pCoreBase = pCoreBase; - controller->Controller.private_data = controller; controller->Controller.start = dma_controller_start; controller->Controller.stop = dma_controller_stop; controller->Controller.channel_alloc = dma_channel_allocate; diff --git a/drivers/usb/musb/tusb6010_omap.c b/drivers/usb/musb/tusb6010_omap.c index 09a6a3cc8e1..0c951fe6ce5 100644 --- a/drivers/usb/musb/tusb6010_omap.c +++ b/drivers/usb/musb/tusb6010_omap.c @@ -689,7 +689,6 @@ dma_controller_create(struct musb *musb, void __iomem *base) tusb_dma->controller.channel_release = tusb_omap_dma_release; tusb_dma->controller.channel_program = tusb_omap_dma_program; tusb_dma->controller.channel_abort = tusb_omap_dma_abort; - tusb_dma->controller.private_data = tusb_dma; if (tusb_get_revision(musb) >= TUSB_REV_30) tusb_dma->multichannel = 1; -- 2.41.1