From patchwork Sat Mar 4 12:36:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 9603919 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 7DB4B602B4 for ; Sat, 4 Mar 2017 12:39:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6BFBC2843F for ; Sat, 4 Mar 2017 12:39:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 60B592854F; Sat, 4 Mar 2017 12:39:06 +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 043692843F for ; Sat, 4 Mar 2017 12:39:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752012AbdCDMjE (ORCPT ); Sat, 4 Mar 2017 07:39:04 -0500 Received: from mail-wr0-f195.google.com ([209.85.128.195]:36557 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751945AbdCDMi5 (ORCPT ); Sat, 4 Mar 2017 07:38:57 -0500 Received: by mail-wr0-f195.google.com with SMTP id l37so16202044wrc.3 for ; Sat, 04 Mar 2017 04:38:25 -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=4y1nkLcjETkhrginY1GGOKz2PzHWSop5iaewiGKQd/k=; b=nZ0IYB4QrfMV3tDWe2FKIqFuD7Cws2qfnX6UvzU2665IzfP0BOFnZO3Z9IplGssqlr 7PAVdxAAbrv3t5OOC6UowBPWkn81ZWdNbnUPnN0MWN6IJQwdVrcaTL2aTMfVVUgEuWtU awj+N0zCFrrqnDyMjBdcPVL2ZjiDJkPZttg3h5M65T+d0ORORhmJmMeDZApu0irh2UM9 LY+gPwKSqO0sq2WyEOJIl1KwQA5GyhI07ZbB3a8BsyR2mF0igFODgUrWBRqns4DrWdzy qLAaikKQjHTI5Q2O9UCM291koLIMLfMwNjNHzfl7rbT28z9cSAI3H6Qr07PeT2a+I/jJ WYDA== 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=4y1nkLcjETkhrginY1GGOKz2PzHWSop5iaewiGKQd/k=; b=JMgRFik4wTWBd0DKhM10MECUvV4hPmWzw7mvEWBNpuKJRG2yvFXpBBGdMfvZFG0MhO 6IyS0qzv5JUspoMS4/KsM/kynZhFz96O3YE/CnL/+uKl1HJMZSYDFF7/wEwZvH9uUoX6 GPvyPt/8JoTpFY5n1L06/NlbuZ1kfSI80IZzYdHKaPsD/cA3EZqpm1/OncO+KOxL6A09 1sTph0mTaOOi20RjE5eVsA02nZnG8ym/njxjfCpudVMbA2vmBdIBZMrVmuhMNIgprfpQ wEbQZ+mUysotRhngB4KbtR/r6onOkJBQvnM36rTXSf9zbgdP3YjA2ekrIJ+603sHDS// ClKA== X-Gm-Message-State: AMke39mEcou2GnAr/ATGXDM7SFd4iWDWg5woEvUaIjMH5vnljZ1OfMnZ8Y07EmEoCA9dKg== X-Received: by 10.223.183.6 with SMTP id l6mr6639917wre.60.1488631104405; Sat, 04 Mar 2017 04:38:24 -0800 (PST) Received: from ?IPv6:2003:c6:ebdc:4000:98cd:c51c:6f4e:443? (p200300C6EBDC400098CDC51C6F4E0443.dip0.t-ipconnect.de. [2003:c6:ebdc:4000:98cd:c51c:6f4e:443]) by smtp.googlemail.com with ESMTPSA id 63sm6872400wmp.9.2017.03.04.04.38.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 04 Mar 2017 04:38:23 -0800 (PST) Subject: [PATCH v5 9/10] mmc: meson-gx: remove member mrq from struct meson_host To: Ulf Hansson , Kevin Hilman References: Cc: "linux-mmc@vger.kernel.org" , linux-amlogic@lists.infradead.org From: Heiner Kallweit Message-ID: Date: Sat, 4 Mar 2017 13:36:45 +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: 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 v5: - rebased --- 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 84553c23..d1826cf8 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);