From patchwork Fri Mar 4 10:26:28 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 317 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:41:40 -0000 Delivered-To: patches@linaro.org Received: by 10.224.60.68 with SMTP id o4cs9883qah; Fri, 4 Mar 2011 02:26:30 -0800 (PST) Received: by 10.224.9.4 with SMTP id j4mr291904qaj.311.1299234390230; Fri, 04 Mar 2011 02:26:30 -0800 (PST) Received: from mail-qy0-f171.google.com (mail-qy0-f171.google.com [209.85.216.171]) by mx.google.com with ESMTPS id v19si1475509vds.113.2011.03.04.02.26.29 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 04 Mar 2011 02:26:29 -0800 (PST) Received-SPF: neutral (google.com: 209.85.216.171 is neither permitted nor denied by best guess record for domain of linus.walleij@linaro.org) client-ip=209.85.216.171; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.216.171 is neither permitted nor denied by best guess record for domain of linus.walleij@linaro.org) smtp.mail=linus.walleij@linaro.org Received: by qyj19 with SMTP id 19so33186qyj.16 for ; Fri, 04 Mar 2011 02:26:28 -0800 (PST) MIME-Version: 1.0 Received: by 10.224.220.212 with SMTP id hz20mr329923qab.234.1299234388833; Fri, 04 Mar 2011 02:26:28 -0800 (PST) Received: by 10.224.28.201 with HTTP; Fri, 4 Mar 2011 02:26:28 -0800 (PST) In-Reply-To: <1297350590-2344-1-git-send-email-linus.walleij@linaro.org> References: <1297350590-2344-1-git-send-email-linus.walleij@linaro.org> Date: Fri, 4 Mar 2011 11:26:28 +0100 Message-ID: Subject: Fwd: [PATCH 06/11] sh_mmcif: rename and retype activity variable From: Linus Walleij To: Patch Tracking ---------- Forwarded message ---------- From: Linus Walleij Date: Thu, Feb 10, 2011 at 4:09 PM Subject: [PATCH 06/11] sh_mmcif: rename and retype activity variable To: linux-mmc@vger.kernel.org, Chris Ball Cc: Dan Williams , Paul Mundt , Linus Walleij The host_sglen is now actually used to keep track of whether DMA is active or not, so rename and retype it to bool. Signed-off-by: Linus Walleij ---  drivers/mmc/host/sh_mmcif.c |   18 +++++++++---------  1 files changed, 9 insertions(+), 9 deletions(-)        } @@ -241,7 +241,7 @@ static void sh_mmcif_start_dma_rx(struct sh_mmcif_host *host)                if (ret >= 0)                        ret = -EIO;                host->chan_rx = NULL; -               host->dma_sglen = 0; +               host->dma_active = false;                dma_release_channel(chan);                /* Free the Tx channel too */                chan = host->chan_tx; @@ -269,7 +269,7 @@ static void sh_mmcif_start_dma_tx(struct sh_mmcif_host *host)        ret = dma_map_sg(chan->device->dev, sg, host->data->sg_len,                         DMA_TO_DEVICE);        if (ret > 0) { -               host->dma_sglen = ret; +               host->dma_active = true;                desc = chan->device->device_prep_slave_sg(chan, sg, ret,                        DMA_TO_DEVICE, DMA_PREP_INTERRUPT | DMA_CTRL_ACK);        } @@ -294,7 +294,7 @@ static void sh_mmcif_start_dma_tx(struct sh_mmcif_host *host)                if (ret >= 0)                        ret = -EIO;                host->chan_tx = NULL; -               host->dma_sglen = 0; +               host->dma_active = false;                dma_release_channel(chan);                /* Free the Rx channel too */                chan = host->chan_rx; @@ -321,7 +321,7 @@ static bool sh_mmcif_filter(struct dma_chan *chan, void *arg)  static void sh_mmcif_request_dma(struct sh_mmcif_host *host,                                 struct sh_mmcif_plat_data *pdata)  { -       host->dma_sglen = 0; +       host->dma_active = false;        /* We can only either use DMA for both Tx and Rx or not use it at all */        if (pdata->dma) { @@ -368,7 +368,7 @@ static void sh_mmcif_release_dma(struct sh_mmcif_host *host)                dma_release_channel(chan);        } -       host->dma_sglen = 0; +       host->dma_active = false;  }  static void sh_mmcif_clock_control(struct sh_mmcif_host *host, unsigned int clk) @@ -757,7 +757,7 @@ static void sh_mmcif_start_cmd(struct sh_mmcif_host *host,        }        sh_mmcif_get_response(host, cmd);        if (host->data) { -               if (!host->dma_sglen) { +               if (!host->dma_active) {                        ret = sh_mmcif_data_trans(host, mrq, cmd->opcode);                } else {                        long time = @@ -769,7 +769,7 @@ static void sh_mmcif_start_cmd(struct sh_mmcif_host *host,                                ret = time;                        sh_mmcif_bitclr(host, MMCIF_CE_BUF_ACC,                                        BUF_ACC_DMAREN | BUF_ACC_DMAWEN); -                       host->dma_sglen = 0; +                       host->dma_active = false;                }                if (ret < 0)                        mrq->data->bytes_xfered = 0; -- 1.7.4 diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c index 61ad19e..e247031 100644 --- a/drivers/mmc/host/sh_mmcif.c +++ b/drivers/mmc/host/sh_mmcif.c @@ -169,7 +169,7 @@ struct sh_mmcif_host {        struct dma_chan         *chan_rx;        struct dma_chan         *chan_tx;        struct completion       dma_complete; -       unsigned int            dma_sglen; +       bool                    dma_active;  };  static inline void sh_mmcif_bitset(struct sh_mmcif_host *host, @@ -216,7 +216,7 @@ static void sh_mmcif_start_dma_rx(struct sh_mmcif_host *host)        ret = dma_map_sg(chan->device->dev, sg, host->data->sg_len,                         DMA_FROM_DEVICE);        if (ret > 0) { -               host->dma_sglen = ret; +               host->dma_active = true;                desc = chan->device->device_prep_slave_sg(chan, sg, ret,                        DMA_FROM_DEVICE, DMA_PREP_INTERRUPT | DMA_CTRL_ACK);