Re: [PATCH v4 1/3] dmaengine: add dma_get_slave_sg_limits()

From: Vinod Koul
Date: Thu Mar 21 2013 - 03:09:05 EST

On Wed, Mar 06, 2013 at 02:56:05PM -0500, Matt Porter wrote:
> Add a dmaengine API to retrieve slave SG transfer limits.
> The API is optionally implemented by dmaengine drivers and when
> unimplemented will return a NULL pointer. A client driver using
> this API provides the required dma channel, address width, and
> burst size of the transfer. dma_get_slave_sg_limits() returns an
> SG limits structure with the maximum number and size of SG segments
> that the given channel can handle.
> Signed-off-by: Matt Porter <mporter@xxxxxx>
> ---
> +static inline struct dma_slave_sg_limits
> +*dma_get_slave_sg_limits(struct dma_chan *chan,
> + enum dma_slave_buswidth addr_width,
> + u32 maxburst)
> +{
> + if (chan->device->device_slave_sg_limits)
> + return chan->device->device_slave_sg_limits(chan,
> + addr_width,
> + maxburst);
Hi Matt,

Sorry for delayed reply, this series was sent just before i went for vacation :)

I agree with Lars, that returning pointer maynot be good idea. So this bit needs
work. Also the readblity of above is bad by complying to 80char limit. I would
make it easier to read

> +
> + return NULL;
> +}
> +
> enum dma_status dma_sync_wait(struct dma_chan *chan, dma_cookie_t cookie);
> enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx);
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at