diff mbox

[v2,29/41] dmaengine: ste_dma40: convert callback to helper function

Message ID 146861403118.154751.8466715597377244116.stgit@djiang5-desk3.ch.intel.com (mailing list archive)
State Changes Requested
Headers show

Commit Message

Dave Jiang July 15, 2016, 8:20 p.m. UTC
Convert driver to use the new helper function for callback

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/dma/ste_dma40.c |   10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)


--
To unsubscribe from this list: send the line "unsubscribe dmaengine" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

kernel test robot July 16, 2016, 12:38 a.m. UTC | #1
Hi,

[auto build test ERROR on v4.7-rc7]
[also build test ERROR on next-20160715]
[cannot apply to slave-dma/next xlnx/master]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Dave-Jiang/Adding-transaction-result-return-for-dmaengine/20160716-044852
config: arm-multi_v7_defconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (Debian 5.3.1-8) 5.3.1 20160205
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=arm 

All errors (new ones prefixed by >>):

   drivers/dma/ste_dma40.c: In function 'dma_tasklet':
>> drivers/dma/ste_dma40.c:1599:2: error: unknown type name 'dmaengine_desc_callback'
     dmaengine_desc_callback cb;
     ^
>> drivers/dma/ste_dma40.c:1626:42: error: passing argument 2 of 'dmaengine_desc_get_callback' from incompatible pointer type [-Werror=incompatible-pointer-types]
     dmaengine_desc_get_callback(&d40d->txd, &cb);
                                             ^
   In file included from drivers/dma/ste_dma40.c:13:0:
   include/linux/dmaengine.h:1381:1: note: expected 'struct dmaengine_desc_callback *' but argument is of type 'int *'
    dmaengine_desc_get_callback(struct dma_async_tx_descriptor *tx,
    ^
>> drivers/dma/ste_dma40.c:1648:34: error: passing argument 1 of 'dmaengine_desc_callback_invoke' from incompatible pointer type [-Werror=incompatible-pointer-types]
      dmaengine_desc_callback_invoke(&cb, NULL);
                                     ^
   In file included from drivers/dma/ste_dma40.c:13:0:
   include/linux/dmaengine.h:1389:1: note: expected 'struct dmaengine_desc_callback *' but argument is of type 'int *'
    dmaengine_desc_callback_invoke(struct dmaengine_desc_callback *cb,
    ^
   cc1: some warnings being treated as errors

vim +/dmaengine_desc_callback +1599 drivers/dma/ste_dma40.c

  1593	static void dma_tasklet(unsigned long data)
  1594	{
  1595		struct d40_chan *d40c = (struct d40_chan *) data;
  1596		struct d40_desc *d40d;
  1597		unsigned long flags;
  1598		bool callback_active;
> 1599		dmaengine_desc_callback cb;
  1600	
  1601		spin_lock_irqsave(&d40c->lock, flags);
  1602	
  1603		/* Get first entry from the done list */
  1604		d40d = d40_first_done(d40c);
  1605		if (d40d == NULL) {
  1606			/* Check if we have reached here for cyclic job */
  1607			d40d = d40_first_active_get(d40c);
  1608			if (d40d == NULL || !d40d->cyclic)
  1609				goto err;
  1610		}
  1611	
  1612		if (!d40d->cyclic)
  1613			dma_cookie_complete(&d40d->txd);
  1614	
  1615		/*
  1616		 * If terminating a channel pending_tx is set to zero.
  1617		 * This prevents any finished active jobs to return to the client.
  1618		 */
  1619		if (d40c->pending_tx == 0) {
  1620			spin_unlock_irqrestore(&d40c->lock, flags);
  1621			return;
  1622		}
  1623	
  1624		/* Callback to client */
  1625		callback_active = !!(d40d->txd.flags & DMA_PREP_INTERRUPT);
> 1626		dmaengine_desc_get_callback(&d40d->txd, &cb);
  1627	
  1628		if (!d40d->cyclic) {
  1629			if (async_tx_test_ack(&d40d->txd)) {
  1630				d40_desc_remove(d40d);
  1631				d40_desc_free(d40c, d40d);
  1632			} else if (!d40d->is_in_client_list) {
  1633				d40_desc_remove(d40d);
  1634				d40_lcla_free_all(d40c, d40d);
  1635				list_add_tail(&d40d->node, &d40c->client);
  1636				d40d->is_in_client_list = true;
  1637			}
  1638		}
  1639	
  1640		d40c->pending_tx--;
  1641	
  1642		if (d40c->pending_tx)
  1643			tasklet_schedule(&d40c->tasklet);
  1644	
  1645		spin_unlock_irqrestore(&d40c->lock, flags);
  1646	
  1647		if (callback_active)
> 1648			dmaengine_desc_callback_invoke(&cb, NULL);
  1649	
  1650		return;
  1651	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
diff mbox

Patch

diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index 6fb8307..37ad656 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -1596,8 +1596,7 @@  static void dma_tasklet(unsigned long data)
 	struct d40_desc *d40d;
 	unsigned long flags;
 	bool callback_active;
-	dma_async_tx_callback callback;
-	void *callback_param;
+	dmaengine_desc_callback cb;
 
 	spin_lock_irqsave(&d40c->lock, flags);
 
@@ -1624,8 +1623,7 @@  static void dma_tasklet(unsigned long data)
 
 	/* Callback to client */
 	callback_active = !!(d40d->txd.flags & DMA_PREP_INTERRUPT);
-	callback = d40d->txd.callback;
-	callback_param = d40d->txd.callback_param;
+	dmaengine_desc_get_callback(&d40d->txd, &cb);
 
 	if (!d40d->cyclic) {
 		if (async_tx_test_ack(&d40d->txd)) {
@@ -1646,8 +1644,8 @@  static void dma_tasklet(unsigned long data)
 
 	spin_unlock_irqrestore(&d40c->lock, flags);
 
-	if (callback_active && callback)
-		callback(callback_param);
+	if (callback_active)
+		dmaengine_desc_callback_invoke(&cb, NULL);
 
 	return;