From patchwork Wed Apr 6 09:25:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 8759891 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 06C699FD89 for ; Wed, 6 Apr 2016 09:26:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C037E201DD for ; Wed, 6 Apr 2016 09:26:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E5B8F201D3 for ; Wed, 6 Apr 2016 09:26:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933970AbcDFJ0C (ORCPT ); Wed, 6 Apr 2016 05:26:02 -0400 Received: from sauhun.de ([89.238.76.85]:58212 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755124AbcDFJZw (ORCPT ); Wed, 6 Apr 2016 05:25:52 -0400 Received: from p4fe25799.dip0.t-ipconnect.de ([79.226.87.153]:36628 helo=localhost) by pokefinder.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1anjie-0000bP-SX; Wed, 06 Apr 2016 11:25:49 +0200 From: Wolfram Sang To: linux-mmc@vger.kernel.org Cc: Wolfram Sang , linux-renesas-soc@vger.kernel.org, linux-sh@vger.kernel.org, Simon Horman , Kuninori Morimoto Subject: [PATCH 4/6] mmc: tmio: simplify irq handler Date: Wed, 6 Apr 2016 11:25:32 +0200 Message-Id: <1459934734-3613-5-git-send-email-wsa@the-dreams.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1459934734-3613-1-git-send-email-wsa@the-dreams.de> References: <1459934734-3613-1-git-send-email-wsa@the-dreams.de> Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Wolfram Sang Having just one irq handler again, let's include the 'card_status' function in the main handler which is way more readable. Drop a useless debug output while here. It should be a dev_dbg in case we ever need it again. Signed-off-by: Wolfram Sang --- drivers/mmc/host/tmio_mmc_pio.c | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c index a7250a5fa670c5..879e0f5455ef44 100644 --- a/drivers/mmc/host/tmio_mmc_pio.c +++ b/drivers/mmc/host/tmio_mmc_pio.c @@ -632,19 +632,6 @@ out: spin_unlock(&host->lock); } -static void tmio_mmc_card_irq_status(struct tmio_mmc_host *host, - int *ireg, int *status) -{ - *status = sd_ctrl_read32(host, CTL_STATUS); - *ireg = *status & TMIO_MASK_IRQ & ~host->sdcard_irq_mask; - - pr_debug_status(*status); - pr_debug_status(*ireg); - - /* Clear the status except the interrupt status */ - sd_ctrl_write32(host, CTL_STATUS, TMIO_MASK_IRQ); -} - static bool __tmio_mmc_card_detect_irq(struct tmio_mmc_host *host, int ireg, int status) { @@ -722,9 +709,15 @@ irqreturn_t tmio_mmc_irq(int irq, void *devid) struct tmio_mmc_host *host = devid; unsigned int ireg, status; - pr_debug("MMC IRQ begin\n"); + status = sd_ctrl_read32(host, CTL_STATUS); + ireg = status & TMIO_MASK_IRQ & ~host->sdcard_irq_mask; + + pr_debug_status(status); + pr_debug_status(ireg); + + /* Clear the status except the interrupt status */ + sd_ctrl_write32(host, CTL_STATUS, TMIO_MASK_IRQ); - tmio_mmc_card_irq_status(host, &ireg, &status); if (__tmio_mmc_card_detect_irq(host, ireg, status)) return IRQ_HANDLED; if (__tmio_mmc_sdcard_irq(host, ireg, status))