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>
This commit is contained in:

committed by
Felipe Balbi

parent
ff2283229d
commit
66c01883ef
@@ -37,18 +37,10 @@
|
||||
#include "musb_core.h"
|
||||
#include "musbhsdma.h"
|
||||
|
||||
static int dma_controller_start(struct dma_controller *c)
|
||||
{
|
||||
/* nothing to do */
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void dma_channel_release(struct dma_channel *channel);
|
||||
|
||||
static int dma_controller_stop(struct dma_controller *c)
|
||||
static void dma_controller_stop(struct musb_dma_controller *controller)
|
||||
{
|
||||
struct musb_dma_controller *controller = container_of(c,
|
||||
struct musb_dma_controller, controller);
|
||||
struct musb *musb = controller->private_data;
|
||||
struct dma_channel *channel;
|
||||
u8 bit;
|
||||
@@ -67,8 +59,6 @@ static int dma_controller_stop(struct dma_controller *c)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct dma_channel *dma_channel_allocate(struct dma_controller *c,
|
||||
@@ -371,6 +361,8 @@ void dma_controller_destroy(struct dma_controller *c)
|
||||
struct musb_dma_controller *controller = container_of(c,
|
||||
struct musb_dma_controller, controller);
|
||||
|
||||
dma_controller_stop(controller);
|
||||
|
||||
if (controller->irq)
|
||||
free_irq(controller->irq, c);
|
||||
|
||||
@@ -397,8 +389,6 @@ struct dma_controller *dma_controller_create(struct musb *musb, void __iomem *ba
|
||||
controller->private_data = musb;
|
||||
controller->base = base;
|
||||
|
||||
controller->controller.start = dma_controller_start;
|
||||
controller->controller.stop = dma_controller_stop;
|
||||
controller->controller.channel_alloc = dma_channel_allocate;
|
||||
controller->controller.channel_release = dma_channel_release;
|
||||
controller->controller.channel_program = dma_channel_program;
|
||||
|
Reference in New Issue
Block a user