From patchwork Thu Feb 16 19:42:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 9578259 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 CF77A60586 for ; Thu, 16 Feb 2017 19:43:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C18A02866B for ; Thu, 16 Feb 2017 19:43:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B65F728672; Thu, 16 Feb 2017 19:43:53 +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=-1.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 64BD42866F for ; Thu, 16 Feb 2017 19:43:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:References:To:Subject:From:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=5NdIYb3U4f8pxZjJ6Jd87yCXtJWMqPIr+zrDA/lqFh0=; b=idjO9ssDCykfd1 YlOqtcaWPjIJUJxfMpf0st21vnUNoBxppLQ8cl7kQOpn8bjBngkdjjihqlQ6tkOQ6LIuf3AeT8/bm yGqjpc9DCBX3PyAV5KS79wLMf3N3QABiKDK74Ij3Af4VzF5NYcIavp6KeBUiUShFdA5WjoOqOzIxp UjP1Xd1ZM6pNPnB45TDClWeNL87HwSWfW5Uzf03BOmsI68W6/WXTtOXQf/U1h9Je7QuxzWuQ0b4aP nALaPmZnrPcuSX9Licgr6zYi8tK57yUQpYKsO6nchBESUcd29RI5WEYKVk8IqrOobJ9Z3qL32xgHN R+cJUvrm8riOi6dbFivQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1ceRxw-0006vo-Ay; Thu, 16 Feb 2017 19:43:44 +0000 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1ceRxj-0006gM-Tl for linux-amlogic@lists.infradead.org; Thu, 16 Feb 2017 19:43:38 +0000 Received: by mail-wm0-x243.google.com with SMTP id c85so4697081wmi.1 for ; Thu, 16 Feb 2017 11:43:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:subject:to:references:cc:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=IJXv2ZHhVJR2l16+l6PtMlfk5bEhHJadgIHXfviOwGM=; b=Hfopgmk59OvvA2r0oOO0GCCnIcBT+W7ayPn2qAp/JYS7XjoFQJ4x6/JqDKjVqNwSb7 cYDeA54Ap50+2xw4tqvCQKaRE5jqJZ0eqjHwu5nqMf6nT27bnU0apksqfSQHdhX5Kuc2 DyzYdhCd2ig2Px4tg11Ra1e2LVf7gX2otLYbmWXZlUmzw88Qt1kzMyacqNkvtdvEG6ZE lFXuFUO4hd7Bljp+TMCXgibLbRmP3uS+ZQybtnkOrq9W6ObcRoqqidpZBcVqcTNU+Maz QujwOdyzVWFdNKXuJZlzYi14ObuZ5Rez3xItnMTFogeChyQj3brZ+mwt1p48peBU5tq/ VVEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:references:cc:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=IJXv2ZHhVJR2l16+l6PtMlfk5bEhHJadgIHXfviOwGM=; b=XlJqyxZGiUBKAfvZARsZPaIZkNmmr0ZDSkNrHSWJR5ytOLxDNIopIfYeOFWlDQir6g A1YTvumxHrm1gzvC9fjo7k3X8loGBUsEh0GMj8a9ONFLvb1JhmZeKzPECSlxMhN+3Ufz CLfkn/uJlOJEyTVN/jz1TUE8lrb9DZEv5RV8Z83RSph48O77V4C6fsbdfhUT1GgJKVix LBL/4s4KU3T/tnTwXdnVPRVSnh3TMZCXxbmOl5c639G6Th4cnOWVOXAAV4yS2gGWzfEd mAxYnGDzLEwJmtdNyPpyq7oKBEaN6R1DIl7R6V2h5ijM542rxwVU0+5MHe48jlqwYLeI Ldfg== X-Gm-Message-State: AMke39nrnAqO+TeNUX6DWiUeyeVjCMfC2u0EgJF9M25+unxMxJanUNZ/8gXizGVS00O47g== X-Received: by 10.28.144.66 with SMTP id s63mr14385119wmd.134.1487274192964; Thu, 16 Feb 2017 11:43:12 -0800 (PST) Received: from ?IPv6:2003:c6:ebdc:4000:f02a:ffb3:d41d:abac? (p200300C6EBDC4000F02AFFB3D41DABAC.dip0.t-ipconnect.de. [2003:c6:ebdc:4000:f02a:ffb3:d41d:abac]) by smtp.googlemail.com with ESMTPSA id w17sm10172174wra.28.2017.02.16.11.43.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Feb 2017 11:43:12 -0800 (PST) From: Heiner Kallweit Subject: [PATCH v2 9/9] mmc: meson-gx: remove member mrq from struct meson_host To: Ulf Hansson , Kevin Hilman References: <7d5263e2-9325-dedb-a5f6-954c4a09e977@gmail.com> Message-ID: Date: Thu, 16 Feb 2017 20:42:47 +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: <7d5263e2-9325-dedb-a5f6-954c4a09e977@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170216_114332_566707_D1AAB91E X-CRM114-Status: UNSURE ( 8.53 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-amlogic@lists.infradead.org, "linux-mmc@vger.kernel.org" Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.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 --- 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 e7c3ac1c..3c35cf1f 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; @@ -412,9 +411,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); } @@ -521,13 +517,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 @@ -551,7 +543,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; @@ -561,11 +552,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; @@ -612,7 +598,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; @@ -639,14 +625,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; @@ -660,8 +642,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);