aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/musb/musbhsdma.c
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2013-06-19 11:38:11 -0400
committerFelipe Balbi <balbi@ti.com>2013-07-29 06:53:18 -0400
commit66c01883ef19bf4537b16931567b7d35c65356ad (patch)
tree99da616e10bf13181dad379d97748980784c74e6 /drivers/usb/musb/musbhsdma.c
parentff2283229da616d9a029eaa0d483fa8b0ad55e77 (diff)
usb: musb: dma: merge ->start/stop into create/destroy
The core code creates a controller and immediately after that it calls the ->start() callback. This one might drop an error but nobody cares. The same thing happens in the destroy corner: First ->stop() called followed by destroy callback. So why not merge those two into the same function since there is no difference. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/musb/musbhsdma.c')
-rw-r--r--drivers/usb/musb/musbhsdma.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/drivers/usb/musb/musbhsdma.c b/drivers/usb/musb/musbhsdma.c
index 3f5e121dc154..e8e9f9aab203 100644
--- a/drivers/usb/musb/musbhsdma.c
+++ b/drivers/usb/musb/musbhsdma.c
@@ -37,18 +37,10 @@
37#include "musb_core.h" 37#include "musb_core.h"
38#include "musbhsdma.h" 38#include "musbhsdma.h"
39 39
40static int dma_controller_start(struct dma_controller *c)
41{
42 /* nothing to do */
43 return 0;
44}
45
46static void dma_channel_release(struct dma_channel *channel); 40static void dma_channel_release(struct dma_channel *channel);
47 41
48static int dma_controller_stop(struct dma_controller *c) 42static void dma_controller_stop(struct musb_dma_controller *controller)
49{ 43{
50 struct musb_dma_controller *controller = container_of(c,
51 struct musb_dma_controller, controller);
52 struct musb *musb = controller->private_data; 44 struct musb *musb = controller->private_data;
53 struct dma_channel *channel; 45 struct dma_channel *channel;
54 u8 bit; 46 u8 bit;
@@ -67,8 +59,6 @@ static int dma_controller_stop(struct dma_controller *c)
67 } 59 }
68 } 60 }
69 } 61 }
70
71 return 0;
72} 62}
73 63
74static struct dma_channel *dma_channel_allocate(struct dma_controller *c, 64static struct dma_channel *dma_channel_allocate(struct dma_controller *c,
@@ -371,6 +361,8 @@ void dma_controller_destroy(struct dma_controller *c)
371 struct musb_dma_controller *controller = container_of(c, 361 struct musb_dma_controller *controller = container_of(c,
372 struct musb_dma_controller, controller); 362 struct musb_dma_controller, controller);
373 363
364 dma_controller_stop(controller);
365
374 if (controller->irq) 366 if (controller->irq)
375 free_irq(controller->irq, c); 367 free_irq(controller->irq, c);
376 368
@@ -397,8 +389,6 @@ struct dma_controller *dma_controller_create(struct musb *musb, void __iomem *ba
397 controller->private_data = musb; 389 controller->private_data = musb;
398 controller->base = base; 390 controller->base = base;
399 391
400 controller->controller.start = dma_controller_start;
401 controller->controller.stop = dma_controller_stop;
402 controller->controller.channel_alloc = dma_channel_allocate; 392 controller->controller.channel_alloc = dma_channel_allocate;
403 controller->controller.channel_release = dma_channel_release; 393 controller->controller.channel_release = dma_channel_release;
404 controller->controller.channel_program = dma_channel_program; 394 controller->controller.channel_program = dma_channel_program;