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: 9578243 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 84D2760209 for ; Thu, 16 Feb 2017 19:43:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 78C522866B for ; Thu, 16 Feb 2017 19:43:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6D9A72866E; Thu, 16 Feb 2017 19:43:16 +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 090682866B for ; Thu, 16 Feb 2017 19:43:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933224AbdBPTnP (ORCPT ); Thu, 16 Feb 2017 14:43:15 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:35660 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933233AbdBPTnO (ORCPT ); Thu, 16 Feb 2017 14:43:14 -0500 Received: by mail-wm0-f65.google.com with SMTP id u63so4670828wmu.2 for ; Thu, 16 Feb 2017 11:43:13 -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=dYvun5pcBOezLXegK43O3g8fIaxxkTxamzwZj+Q/99FcL51WztHu4rY9s8glr/PUtZ FotW3Qdu0demR1N5zYe2+TFgDE6RWPa3mqEouhMjQ5/Ws8NLnMeOzjpJM3XVB2fyAwqK aRy7i6P8+rUw4gZ+AWtqTakDYUiMiF/ePemSH9lP0YQxx9AQV/PvAVDBSrQSNlNdzxtq PIfsuPS6qXa5gKUQlT/Z6NtGokJvR9IXJF+o3/oOkBOMyzj2khYcgpEw+WxHGXy4dg4N a/7sR0cITmrNP7nlguOoENhL1l50+BJc7EO8C+jzxwTtzrv7Zomkth+7px6Mm1tebPlr 9YRA== X-Gm-Message-State: AMke39kv1pZyz1mUFSbLudZH3vtWS0kZtpP0DWvNDPKHCDt8ktkObkzjLLlRJM5P+yOnVw== 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> Cc: "linux-mmc@vger.kernel.org" , linux-amlogic@lists.infradead.org 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> 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 --- 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);