diff mbox

[V2,2/3] dmaengine: dw_dmac: Enhance device tree support

Message ID CAKohpo=20mwje+9AVgs7b-_DshyRO2DZ=Nacjm7vFAhed=Wkqg@mail.gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Viresh Kumar Oct. 15, 2012, 3:29 a.m. UTC
On 12 October 2012 20:28, Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>> +     if (last_dw) {
>> +             if ((last_bus_id == param) && (last_dw == dw))
>> +                     return false;
>> +     }
> Just came to my mind.
> dw can't be NULL, can't it?
> Then
> if (last_dw) {
> ...
> }
> is unneeded.

Fixup for this:

         * - If dw_dma's platform data is not filled with slave info, then all

Comments

Andy Shevchenko Oct. 15, 2012, 7:35 a.m. UTC | #1
On Mon, 2012-10-15 at 08:59 +0530, Viresh Kumar wrote: 
> On 12 October 2012 20:28, Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> >> +     if (last_dw) {
> >> +             if ((last_bus_id == param) && (last_dw == dw))
> >> +                     return false;
> >> +     }
> > Just came to my mind.
> > dw can't be NULL, can't it?
> > Then
> > if (last_dw) {
> > ...
> > }
> > is unneeded.
> 
> Fixup for this:
> 
> diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c
> index d72c26f..764c159 100644
> --- a/drivers/dma/dw_dmac.c
> +++ b/drivers/dma/dw_dmac.c
> @@ -1196,11 +1196,8 @@ bool dw_dma_generic_filter(struct dma_chan
> *chan, void *param)
>          * failure. If dw and param are same, i.e. trying on same dw with
>          * different channel, return false.
>          */
> -       if (last_dw) {
> -               if ((last_bus_id == param) && (last_dw == dw))
> -                       return false;
> -       }
> -
> +       if ((last_dw == dw) && (last_bus_id == param))
> +               return false;
>         /*
>          * Return true:
>          * - If dw_dma's platform data is not filled with slave info, then all
Good.
So, have my 

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> 

for this patch.
diff mbox

Patch

diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c
index d72c26f..764c159 100644
--- a/drivers/dma/dw_dmac.c
+++ b/drivers/dma/dw_dmac.c
@@ -1196,11 +1196,8 @@  bool dw_dma_generic_filter(struct dma_chan
*chan, void *param)
         * failure. If dw and param are same, i.e. trying on same dw with
         * different channel, return false.
         */
-       if (last_dw) {
-               if ((last_bus_id == param) && (last_dw == dw))
-                       return false;
-       }
-
+       if ((last_dw == dw) && (last_bus_id == param))
+               return false;
        /*
         * Return true: