Commit 15a06ec5 authored by David Brownell's avatar David Brownell Committed by Tony Lindgren

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: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
parent f570a6b7
...@@ -1849,7 +1849,7 @@ static void musb_free(struct musb *musb) ...@@ -1849,7 +1849,7 @@ static void musb_free(struct musb *musb)
if (is_dma_capable() && musb->dma_controller) { if (is_dma_capable() && musb->dma_controller) {
struct dma_controller *c = musb->dma_controller; struct dma_controller *c = musb->dma_controller;
(void) c->stop(c->private_data); (void) c->stop(c);
dma_controller_destroy(c); dma_controller_destroy(c);
} }
......
...@@ -136,7 +136,6 @@ dma_channel_status(struct dma_channel *c) ...@@ -136,7 +136,6 @@ dma_channel_status(struct dma_channel *c)
/** /**
* struct dma_controller - A DMA Controller. * struct dma_controller - A DMA Controller.
* @private_data: controller-private data;
* @start: call this to start a DMA controller; * @start: call this to start a DMA controller;
* return 0 on success, else negative errno * return 0 on success, else negative errno
* @stop: call this to stop a DMA controller * @stop: call this to stop a DMA controller
...@@ -149,7 +148,6 @@ dma_channel_status(struct dma_channel *c) ...@@ -149,7 +148,6 @@ dma_channel_status(struct dma_channel *c)
* Controllers manage dma channels. * Controllers manage dma channels.
*/ */
struct dma_controller { struct dma_controller {
void *private_data;
int (*start)(struct dma_controller *); int (*start)(struct dma_controller *);
int (*stop)(struct dma_controller *); int (*stop)(struct dma_controller *);
struct dma_channel *(*channel_alloc)(struct dma_controller *, struct dma_channel *(*channel_alloc)(struct dma_controller *,
......
...@@ -326,6 +326,8 @@ static irqreturn_t dma_controller_irq(int irq, void *private_data) ...@@ -326,6 +326,8 @@ static irqreturn_t dma_controller_irq(int irq, void *private_data)
pImplChannel->Channel.status = pImplChannel->Channel.status =
MUSB_DMA_STATUS_BUS_ABORT; MUSB_DMA_STATUS_BUS_ABORT;
else { else {
u8 devctl;
dwAddress = musb_readl(mbase, dwAddress = musb_readl(mbase,
MUSB_HSDMA_CHANNEL_OFFSET( MUSB_HSDMA_CHANNEL_OFFSET(
bChannel, bChannel,
...@@ -341,8 +343,7 @@ static irqreturn_t dma_controller_irq(int irq, void *private_data) ...@@ -341,8 +343,7 @@ static irqreturn_t dma_controller_irq(int irq, void *private_data)
< pImplChannel->len) ? < pImplChannel->len) ?
"=> reconfig 0": "=> complete"); "=> reconfig 0": "=> complete");
u8 devctl = musb_readb(mbase, devctl = musb_readb(mbase, MUSB_DEVCTL);
MUSB_DEVCTL);
pChannel->status = MUSB_DMA_STATUS_FREE; pChannel->status = MUSB_DMA_STATUS_FREE;
...@@ -376,9 +377,9 @@ done: ...@@ -376,9 +377,9 @@ done:
void dma_controller_destroy(struct dma_controller *c) void dma_controller_destroy(struct dma_controller *c)
{ {
struct musb_dma_controller *controller = struct musb_dma_controller *controller;
(struct musb_dma_controller *) c->private_data;
controller = container_of(c, struct musb_dma_controller, Controller);
if (!controller) if (!controller)
return; return;
...@@ -386,7 +387,6 @@ void dma_controller_destroy(struct dma_controller *c) ...@@ -386,7 +387,6 @@ void dma_controller_destroy(struct dma_controller *c)
free_irq(controller->irq, c); free_irq(controller->irq, c);
kfree(controller); kfree(controller);
c->private_data = NULL;
} }
struct dma_controller *__init struct dma_controller *__init
...@@ -410,7 +410,6 @@ dma_controller_create(struct musb *musb, void __iomem *pCoreBase) ...@@ -410,7 +410,6 @@ dma_controller_create(struct musb *musb, void __iomem *pCoreBase)
controller->pDmaPrivate = musb; controller->pDmaPrivate = musb;
controller->pCoreBase = pCoreBase; controller->pCoreBase = pCoreBase;
controller->Controller.private_data = controller;
controller->Controller.start = dma_controller_start; controller->Controller.start = dma_controller_start;
controller->Controller.stop = dma_controller_stop; controller->Controller.stop = dma_controller_stop;
controller->Controller.channel_alloc = dma_channel_allocate; controller->Controller.channel_alloc = dma_channel_allocate;
......
...@@ -689,7 +689,6 @@ dma_controller_create(struct musb *musb, void __iomem *base) ...@@ -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_release = tusb_omap_dma_release;
tusb_dma->controller.channel_program = tusb_omap_dma_program; tusb_dma->controller.channel_program = tusb_omap_dma_program;
tusb_dma->controller.channel_abort = tusb_omap_dma_abort; tusb_dma->controller.channel_abort = tusb_omap_dma_abort;
tusb_dma->controller.private_data = tusb_dma;
if (tusb_get_revision(musb) >= TUSB_REV_30) if (tusb_get_revision(musb) >= TUSB_REV_30)
tusb_dma->multichannel = 1; tusb_dma->multichannel = 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment