diff mbox

[2/9] dmaengine: Make channel allocation callbacks optional

Message ID 1411808085-27792-3-git-send-email-maxime.ripard@free-electrons.com (mailing list archive)
State Superseded
Headers show

Commit Message

Maxime Ripard Sept. 27, 2014, 8:54 a.m. UTC
Nowadays, some drivers don't have anything in there channel allocation
callbacks anymore.

Remove the BUG_ON if those callbacks aren't implemented, in order to allow
drivers to not implement them.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
 drivers/dma/dmaengine.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Vinod Koul Sept. 28, 2014, 4:07 p.m. UTC | #1
On Sat, Sep 27, 2014 at 10:54:38AM +0200, Maxime Ripard wrote:
> Nowadays, some drivers don't have anything in there channel allocation
> callbacks anymore.
> 
> Remove the BUG_ON if those callbacks aren't implemented, in order to allow
> drivers to not implement them.
> 
> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
> ---
>  drivers/dma/dmaengine.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c
> index d5d30ed863ce..cfcb181b1184 100644
> --- a/drivers/dma/dmaengine.c
> +++ b/drivers/dma/dmaengine.c
> @@ -817,8 +817,6 @@ int dma_async_device_register(struct dma_device *device)
>  	BUG_ON(dma_has_cap(DMA_INTERLEAVE, device->cap_mask) &&
>  		!device->device_prep_interleaved_dma);
>  
> -	BUG_ON(!device->device_alloc_chan_resources);
> -	BUG_ON(!device->device_free_chan_resources);
Dont think we have drivers without free. IIRC cppi one might be only
instance
Maxime Ripard Oct. 1, 2014, 8:39 a.m. UTC | #2
Hi Vinod,

On Sun, Sep 28, 2014 at 09:37:57PM +0530, Vinod Koul wrote:
> On Sat, Sep 27, 2014 at 10:54:38AM +0200, Maxime Ripard wrote:
> > Nowadays, some drivers don't have anything in there channel allocation
> > callbacks anymore.
> > 
> > Remove the BUG_ON if those callbacks aren't implemented, in order to allow
> > drivers to not implement them.
> > 
> > Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
> > ---
> >  drivers/dma/dmaengine.c | 2 --
> >  1 file changed, 2 deletions(-)
> > 
> > diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c
> > index d5d30ed863ce..cfcb181b1184 100644
> > --- a/drivers/dma/dmaengine.c
> > +++ b/drivers/dma/dmaengine.c
> > @@ -817,8 +817,6 @@ int dma_async_device_register(struct dma_device *device)
> >  	BUG_ON(dma_has_cap(DMA_INTERLEAVE, device->cap_mask) &&
> >  		!device->device_prep_interleaved_dma);
> >  
> > -	BUG_ON(!device->device_alloc_chan_resources);
> > -	BUG_ON(!device->device_free_chan_resources);
> Dont think we have drivers without free. IIRC cppi one might be only
> instance

It was more a matter of simmetry to be honest, I'm fine dropping it if
you want.

Maxime
diff mbox

Patch

diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c
index d5d30ed863ce..cfcb181b1184 100644
--- a/drivers/dma/dmaengine.c
+++ b/drivers/dma/dmaengine.c
@@ -817,8 +817,6 @@  int dma_async_device_register(struct dma_device *device)
 	BUG_ON(dma_has_cap(DMA_INTERLEAVE, device->cap_mask) &&
 		!device->device_prep_interleaved_dma);
 
-	BUG_ON(!device->device_alloc_chan_resources);
-	BUG_ON(!device->device_free_chan_resources);
 	BUG_ON(!device->device_tx_status);
 	BUG_ON(!device->device_issue_pending);
 	BUG_ON(!device->dev);