From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lars-Peter Clausen Subject: Re: [PATCH v4 1/3] dmaengine: add dma_get_slave_sg_limits() Date: Mon, 11 Mar 2013 17:57:48 +0100 Message-ID: <513E0D0C.1080203@metafoo.de> References: <1362599767-11292-1-git-send-email-mporter@ti.com> <1362599767-11292-2-git-send-email-mporter@ti.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Received: from smtp-out-222.synserver.de ([212.40.185.222]:1069 "EHLO smtp-out-222.synserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751612Ab3CKQz7 (ORCPT ); Mon, 11 Mar 2013 12:55:59 -0400 In-Reply-To: <1362599767-11292-2-git-send-email-mporter@ti.com> Sender: linux-mmc-owner@vger.kernel.org List-Id: linux-mmc@vger.kernel.org To: Matt Porter Cc: Vinod Koul , Chris Ball , Dan Williams , Sekhar Nori , Grant Likely , Linux DaVinci Kernel List , Linux Kernel Mailing List , Linux MMC List [...] > * struct with auxiliary transfer status information, otherwise the call > * will just return a simple status code > * @device_issue_pending: push pending transactions to hardware > + * @device_slave_sg_limits: return the slave SG capabilities > */ > struct dma_device { > > @@ -602,6 +615,9 @@ struct dma_device { > dma_cookie_t cookie, > struct dma_tx_state *txstate); > void (*device_issue_pending)(struct dma_chan *chan); > + struct dma_slave_sg_limits *(*device_slave_sg_limits)( > + struct dma_chan *chan, enum dma_slave_buswidth addr_width, > + u32 maxburst); In my opinion it is better to pass in a pointer to a dma_slave_sg_limits struct and let the driver fill it. Instead of passing back a pointer to an internal structure. It is kind of problematic because you never really know when the user is done using the struct and you don't know when it is safe to free or reuse it. E.g. in your implementation for the edma driver if the function is called with different parameters for the same channel, the previous result will also be overwritten. - Lars