From patchwork Wed Sep 25 22:31:37 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 2945021 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 33B3ABFF05 for ; Wed, 25 Sep 2013 22:31:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5274720268 for ; Wed, 25 Sep 2013 22:31:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 715862024A for ; Wed, 25 Sep 2013 22:31:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754906Ab3IYWbf (ORCPT ); Wed, 25 Sep 2013 18:31:35 -0400 Received: from mail-la0-f52.google.com ([209.85.215.52]:36414 "EHLO mail-la0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752941Ab3IYWbe (ORCPT ); Wed, 25 Sep 2013 18:31:34 -0400 Received: by mail-la0-f52.google.com with SMTP id ev20so273524lab.25 for ; Wed, 25 Sep 2013 15:31:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:to:subject:cc:from:organization:date :mime-version:content-type:content-transfer-encoding:message-id; bh=Ho543ZPqz3jJ4U64qnI6WpuuATPki8UquX/g8OWHt5c=; b=Ayn0ifEspCB5VZn4N2dQFr1HO03r3Mn+L2lF/WcnSc3MBfVUrpWQrinSIBSttF8DmM sWU4TfLWd+XrgqwrJY8R03ArksxoENUS5+9ZwyjCP1gBodd0hlb3gOxVZ8a9XLEN1exf hNFucxXzTikm14JztgurWbTTu8rrXI78VcQmuk3P2KiZxDNVF3iYdz9huYRq2DQbXZ80 d2QeCM8MEkr/wK4M7505wBZeckSo0hrgxWc7NnANLOjNRju7JzeL4qtRHi4C7UTtPYl1 vvvyJQgP9vrIWDY3cDVmd4u9rRv3FIVyvBD7bfjjPepCmqcM+geXM0CCLoJo8Nkl5bMy E1Yg== X-Gm-Message-State: ALoCoQnUwiCyRvKQgvO63DgUH0bZkitdrjOf88IQ5zmPdZAtAt6b0mlSkxU5I/ICIc7aESFYZdV7 X-Received: by 10.152.44.225 with SMTP id h1mr32154668lam.15.1380148293034; Wed, 25 Sep 2013 15:31:33 -0700 (PDT) Received: from wasted.dev.rtsoft.ru (ppp83-237-61-8.pppoe.mtu-net.ru. [83.237.61.8]) by mx.google.com with ESMTPSA id ap7sm22762567lac.10.1969.12.31.16.00.00 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 25 Sep 2013 15:31:32 -0700 (PDT) To: vinod.koul@intel.com, dan.j.williams@intel.com Subject: [PATCH 2/2] rcar-hpbdma: add parameter to set_slave() method Cc: linux-kernel@vger.kernel.org, linux-sh@vger.kernel.org From: Sergei Shtylyov Organization: Cogent Embedded Date: Thu, 26 Sep 2013 02:31:37 +0400 MIME-Version: 1.0 Message-Id: <201309260231.37773.sergei.shtylyov@cogentembedded.com> Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-8.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Commit 4981c4dc194efb18f0e9a02f1b43e926f2f0d2bb (DMA: shdma: switch DT mode to use configuration data from a match table) added a new parameter to set_slave() method but unfortunately got merged later than commit c4f6c41ba790bbbfcebb4c47a (dma: add driver for R-Car HPB-DMAC), so that the HPB-DMAC driver retained the old prototype which caused this warning: drivers/dma/sh/rcar-hpbdma.c:485: warning: initialization from incompatible pointer type The newly added parameter is used to override DMA slave address from 'struct hpb_dmae_slave_config', so we have to add the 'slave_addr' field to 'struct hpb_dmae_chan', conditionally assign it in set_slave() method, and return in slave_addr() method. Signed-off-by: Sergei Shtylyov Tested-by: Simon Horman --- The patch is against 'fixes-3.12' branch of Vinod Koul's 'slave-dma.git' repo. drivers/dma/sh/rcar-hpbdma.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: slave-dma/drivers/dma/sh/rcar-hpbdma.c =================================================================== --- slave-dma.orig/drivers/dma/sh/rcar-hpbdma.c +++ slave-dma/drivers/dma/sh/rcar-hpbdma.c @@ -93,6 +93,7 @@ struct hpb_dmae_chan { void __iomem *base; const struct hpb_dmae_slave_config *cfg; char dev_id[16]; /* unique name per DMAC of channel */ + dma_addr_t slave_addr; }; struct hpb_dmae_device { @@ -445,7 +446,8 @@ hpb_dmae_alloc_chan_resources(struct hpb return 0; } -static int hpb_dmae_set_slave(struct shdma_chan *schan, int slave_id, bool try) +static int hpb_dmae_set_slave(struct shdma_chan *schan, int slave_id, + dma_addr_t slave_addr, bool try) { struct hpb_dmae_chan *chan = to_chan(schan); const struct hpb_dmae_slave_config *sc = @@ -456,6 +458,7 @@ static int hpb_dmae_set_slave(struct shd if (try) return 0; chan->cfg = sc; + chan->slave_addr = slave_addr ? : sc->addr; return hpb_dmae_alloc_chan_resources(chan, sc); } @@ -467,7 +470,7 @@ static dma_addr_t hpb_dmae_slave_addr(st { struct hpb_dmae_chan *chan = to_chan(schan); - return chan->cfg->addr; + return chan->slave_addr; } static struct shdma_desc *hpb_dmae_embedded_desc(void *buf, int i)