From patchwork Fri Mar 3 19:59:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 9603435 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3E85160414 for ; Fri, 3 Mar 2017 20:00:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2ED4728631 for ; Fri, 3 Mar 2017 20:00:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 239FA28633; Fri, 3 Mar 2017 20:00:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B0DC028632 for ; Fri, 3 Mar 2017 20:00:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752354AbdCCUAx (ORCPT ); Fri, 3 Mar 2017 15:00:53 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:34711 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751820AbdCCUAv (ORCPT ); Fri, 3 Mar 2017 15:00:51 -0500 Received: by mail-wm0-f68.google.com with SMTP id m70so4702718wma.1 for ; Fri, 03 Mar 2017 12:00:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=auDD6qtukXmTR7Dbwmw4g6jjfupRP3B0+zZGOLbNXqQ=; b=UtgsQXERq696R4l4UnzjcFIxyuMuRtWvsGX9D2Hs6Ul+aNBsjVipQIi1GzQOJnntV5 nYa/GRi+ugMQ4G2xfKqSVebKL9fPgxqm0vrA3c3R0fpfyRAl8neugaC6BawcukTkUCmm csYbrufSBVuMbkAfKqqCsjgp8Yg/6sRn6nPHEjZgRrXmF4jcDY3NdhYPhYEVEhBudyFp itEQCoyy6k1IB6s+2f9QeYd0EqBd1Fzr4jWDvRSwRhQFSus86oGH304lHlMLi+ZDsiPB 0PB65/SCi3vWtxjstBNsz0TGnlqpnw7qqonUGU1AnM2+iOKSREwulFsa2rWZMmnkawoB B0Qw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=auDD6qtukXmTR7Dbwmw4g6jjfupRP3B0+zZGOLbNXqQ=; b=SfL+QIR21uAbnFoGwfzSr/7pwxThsNuO6Ab0UTQekGz/nlhxE2+IFd5w1XpwgLH/+o 2pHvJr7SZfAPufuKcbDvhulBSR0fMiTmMfAgKv3XUBWteBvUDeHNnUG7xSEFjCN/TtI6 PKYm8NVRPSl2/AxM41O6tqI6CDGqjinkCLaavjchLoJ7LWcP+IE/17pHXOlbtRE56lnX FGy8GXUE0/MFDPLV+0gSYHNkCm1qoUBIHruO3wXG2da4TjE1vk0hz88CrzFI95ERnwkr 34IdZvg7BsdesNBtzuCWCa6kL3h3VciM9NDuVluKcVCh1zJSt6bV6YnlD/3gykuLsUpU KVOw== X-Gm-Message-State: AMke39mBTTdX2rOkGphpOe3gv5v7nnTcSGrnkTDUJ6v1TO2JaTxG1voIjhZox3LmdY88SQ== X-Received: by 10.28.69.17 with SMTP id s17mr4355000wma.60.1488571249929; Fri, 03 Mar 2017 12:00:49 -0800 (PST) Received: from ?IPv6:2003:c6:ebdc:4000:f903:fe11:afad:80a0? (p200300C6EBDC4000F903FE11AFAD80A0.dip0.t-ipconnect.de. [2003:c6:ebdc:4000:f903:fe11:afad:80a0]) by smtp.googlemail.com with ESMTPSA id 136sm4253586wms.32.2017.03.03.12.00.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Mar 2017 12:00:49 -0800 (PST) Subject: [PATCH v4 9/10] mmc: meson-gx: remove member mrq from struct meson_host To: Ulf Hansson , Kevin Hilman References: <62912f3d-2307-cfff-3c69-c8b8ffaeb474@gmail.com> Cc: "linux-mmc@vger.kernel.org" , linux-amlogic@lists.infradead.org From: Heiner Kallweit Message-ID: Date: Fri, 3 Mar 2017 20:59:16 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <62912f3d-2307-cfff-3c69-c8b8ffaeb474@gmail.com> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Struct mmc_command includes a reference to the related mmc_request. Therefore we don't have to store mrq separately in struct meson_host. And we can remove some now unneeded WARN_ON's. Signed-off-by: Heiner Kallweit Acked-by: Kevin Hilman --- v2: - extended commit message - added acked-by v3: - rebased v4: - no changes --- drivers/mmc/host/meson-gx-mmc.c | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c index e904b0a5..5281014e 100644 --- a/drivers/mmc/host/meson-gx-mmc.c +++ b/drivers/mmc/host/meson-gx-mmc.c @@ -122,7 +122,6 @@ struct meson_host { struct device *dev; struct mmc_host *mmc; - struct mmc_request *mrq; struct mmc_command *cmd; spinlock_t lock; @@ -416,9 +415,6 @@ static void meson_mmc_request_done(struct mmc_host *mmc, { struct meson_host *host = mmc_priv(mmc); - WARN_ON(host->mrq != mrq); - - host->mrq = NULL; host->cmd = NULL; mmc_request_done(host->mmc, mrq); } @@ -525,13 +521,9 @@ static void meson_mmc_request(struct mmc_host *mmc, struct mmc_request *mrq) { struct meson_host *host = mmc_priv(mmc); - WARN_ON(host->mrq != NULL); - /* Stop execution */ writel(0, host->regs + SD_EMMC_START); - host->mrq = mrq; - if (mrq->sbc) meson_mmc_start_cmd(mmc, mrq->sbc); else @@ -555,7 +547,6 @@ static void meson_mmc_read_resp(struct mmc_host *mmc, struct mmc_command *cmd) static irqreturn_t meson_mmc_irq(int irq, void *dev_id) { struct meson_host *host = dev_id; - struct mmc_request *mrq; struct mmc_command *cmd; u32 irq_en, status, raw_status; irqreturn_t ret = IRQ_HANDLED; @@ -565,11 +556,6 @@ static irqreturn_t meson_mmc_irq(int irq, void *dev_id) cmd = host->cmd; - mrq = host->mrq; - - if (WARN_ON(!mrq)) - return IRQ_NONE; - if (WARN_ON(!cmd)) return IRQ_NONE; @@ -616,7 +602,7 @@ static irqreturn_t meson_mmc_irq(int irq, void *dev_id) else { dev_warn(host->dev, "Unknown IRQ! status=0x%04x: MMC CMD%u arg=0x%08x flags=0x%08x stop=%d\n", status, cmd->opcode, cmd->arg, - cmd->flags, mrq->stop ? 1 : 0); + cmd->flags, cmd->mrq->stop ? 1 : 0); if (cmd->data) { struct mmc_data *data = cmd->data; @@ -643,14 +629,10 @@ static irqreturn_t meson_mmc_irq(int irq, void *dev_id) static irqreturn_t meson_mmc_irq_thread(int irq, void *dev_id) { struct meson_host *host = dev_id; - struct mmc_request *mrq = host->mrq; struct mmc_command *cmd = host->cmd; struct mmc_data *data; unsigned int xfer_bytes; - if (WARN_ON(!mrq)) - return IRQ_NONE; - if (WARN_ON(!cmd)) return IRQ_NONE; @@ -664,8 +646,8 @@ static irqreturn_t meson_mmc_irq_thread(int irq, void *dev_id) } meson_mmc_read_resp(host->mmc, cmd); - if (!data || !data->stop || mrq->sbc) - meson_mmc_request_done(host->mmc, mrq); + if (!data || !data->stop || cmd->mrq->sbc) + meson_mmc_request_done(host->mmc, cmd->mrq); else meson_mmc_start_cmd(host->mmc, data->stop);