On Tue, May 10, 2016 at 09:20:40PM +0300, Andy Shevchenko wrote: > Append cmd_resume to be clear what capabilities are actually being supported. > Introduce is_slave_stream_supported() macro to check for all three, cmd_pause, > cmd_resume, and cmd_terminate, to be present. > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx> > --- > In v2: > - introduce cmd_resume instead of renaming cmd_pause > drivers/dma/dmaengine.c | 5 +++-- > drivers/tty/serial/8250/8250_dma.c | 2 +- > include/linux/dmaengine.h | 7 ++++++- > sound/soc/soc-generic-dmaengine-pcm.c | 2 +- > 4 files changed, 11 insertions(+), 5 deletions(-) > > diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c > index 59eb4fa..b5f7f72 100644 > --- a/drivers/dma/dmaengine.c > +++ b/drivers/dma/dmaengine.c > @@ -503,9 +503,10 @@ int dma_get_slave_caps(struct dma_chan *chan, struct dma_slave_caps *caps) > > /* > * Some devices implement only pause (e.g. to get residuum) but no > - * resume. However cmd_pause is advertised as pause AND resume. > + * resume. Setting corresponding bits. > */ > - caps->cmd_pause = !!(device->device_pause && device->device_resume); > + caps->cmd_pause = !!device->device_pause; > + caps->cmd_resume = !!device->device_resume; > caps->cmd_terminate = !!device->device_terminate_all; > > return 0; > diff --git a/drivers/tty/serial/8250/8250_dma.c b/drivers/tty/serial/8250/8250_dma.c > index 7f33d1c..7bb14a3 100644 > --- a/drivers/tty/serial/8250/8250_dma.c > +++ b/drivers/tty/serial/8250/8250_dma.c > @@ -176,7 +176,7 @@ int serial8250_request_dma(struct uart_8250_port *p) > ret = dma_get_slave_caps(dma->rxchan, &caps); > if (ret) > goto release_rx; > - if (!caps.cmd_pause || !caps.cmd_terminate || > + if (!is_slave_stream_supported(&caps) || is_slave_stream_supported this doesn't seem to be great name for checking pause/resume. Can we rename it to is_slave_pause_supported() or something -- ~Vinod -- To unsubscribe from this list: send the line "unsubscribe dmaengine" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html