Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1252796pxa; Thu, 20 Aug 2020 06:50:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx0JeQxpm4napGhcHPPDLLzCC8cwxUlozwVQ/4RLKKyhUqxRjuuOD/ufzmFooDhXXwzHLMM X-Received: by 2002:a05:6402:22bc:: with SMTP id cx28mr2840815edb.171.1597931411756; Thu, 20 Aug 2020 06:50:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597931411; cv=none; d=google.com; s=arc-20160816; b=oaGRwI1B4xW2H+71VfIYKBLwei663HEA/upgw18uqzLIeX0EwIMXO19gZKZ6SVHPcZ XwuZ3iELWBdhQ0m9i4rORPMSJxxq3f7St3BFjs14WW+yibBuojym+MS8YWbL51xc0mSx ToiqyJGy7dvryMwWD3VSXEap+kdwUf1msH8leLuBIU9BcbvjwEyXaxNPmZ6YN+0ZDJio l14iBfS4yIy6JJ/lab11wbnkFAfA/st5Ue9yjoGEcw4m7ZXR2Kv7p4p4bPXmnCrUEtqJ TyHkGuzHSsuoouoRcPCRFw1gygCYFws7x4owLYMDlSTIOM2dEC57IMU6eWbvlt9tlvFY A2Dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=KeSB8vBl+m4gWm1GTnxgMGLiVh3WtymMMLQjt/YqCFQ=; b=uZKnUPhWMmauzJyD8KoU3v7UYMrwRPpMBRQS+wpo9Rr4I31jtScOrFgsvjFOXsZlW9 RYampcdADvg1yGYh35fjjKuMh9JhTyNGWb2MJrU2a+ohy2R7IPvKknnWGb+st3//TT7S Fu8D5SMHwQbTpVSt6J33Npj2cub+TgRYzpqlgUk39ufKmII620hns6zag1zy4pFbBXBZ g6ueopma5KQ3E0nG1mZec1+gvDTW3yHam73sD1yuYVcWdouTg89tA59ampF4P5nkXb1D gLrOVq6VHp+UMfzBw82wNspnZAourlkEuLg9lDrNWzqWeUoJ3HCdHFAJbQD3v2BvfTKH 6SPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=e3lAdZcZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jx1si1233125ejb.520.2020.08.20.06.49.47; Thu, 20 Aug 2020 06:50:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=e3lAdZcZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730632AbgHTNlk (ORCPT + 99 others); Thu, 20 Aug 2020 09:41:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:40486 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728030AbgHTJaK (ORCPT ); Thu, 20 Aug 2020 05:30:10 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7022821744; Thu, 20 Aug 2020 09:30:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597915810; bh=8Nx+WniPGYDtKfMVx4hJjYH84RdLwha1VvyMXy5JftU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=e3lAdZcZZ2Y0lxDQFZQWSnJc/KNTwFPfVPIwql1je7WsopKlHYi2SazQJxlbQjMrz erV6/S1t/tla+jM5gOQP6lSAX/XB5vGXuDtMQfQoVKnSEN5skOusSfrA7lt36gh6bW 8/1pFQjrOzk5HWAl8ukx4uJm8F2U6MjBsKpHnfcc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yoshihiro Shimoda , Wolfram Sang , Ulf Hansson , Sasha Levin Subject: [PATCH 5.8 142/232] mmc: renesas_sdhi_internal_dmac: clean up the code for dma complete Date: Thu, 20 Aug 2020 11:19:53 +0200 Message-Id: <20200820091619.698560829@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200820091612.692383444@linuxfoundation.org> References: <20200820091612.692383444@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yoshihiro Shimoda [ Upstream commit 2b26e34e9af3fa24fa1266e9ea2d66a1f7d62dc0 ] To add end() operation in the future, clean the code of renesas_sdhi_internal_dmac_complete_tasklet_fn(). No behavior change. Signed-off-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/1590044466-28372-3-git-send-email-yoshihiro.shimoda.uh@renesas.com Tested-by: Wolfram Sang Signed-off-by: Ulf Hansson Signed-off-by: Sasha Levin --- drivers/mmc/host/renesas_sdhi_internal_dmac.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/drivers/mmc/host/renesas_sdhi_internal_dmac.c b/drivers/mmc/host/renesas_sdhi_internal_dmac.c index 47ac53e912411..201b8ed37f2e0 100644 --- a/drivers/mmc/host/renesas_sdhi_internal_dmac.c +++ b/drivers/mmc/host/renesas_sdhi_internal_dmac.c @@ -229,15 +229,12 @@ static void renesas_sdhi_internal_dmac_issue_tasklet_fn(unsigned long arg) DTRAN_CTRL_DM_START); } -static void renesas_sdhi_internal_dmac_complete_tasklet_fn(unsigned long arg) +static bool renesas_sdhi_internal_dmac_complete(struct tmio_mmc_host *host) { - struct tmio_mmc_host *host = (struct tmio_mmc_host *)arg; enum dma_data_direction dir; - spin_lock_irq(&host->lock); - if (!host->data) - goto out; + return false; if (host->data->flags & MMC_DATA_READ) dir = DMA_FROM_DEVICE; @@ -250,6 +247,17 @@ static void renesas_sdhi_internal_dmac_complete_tasklet_fn(unsigned long arg) if (dir == DMA_FROM_DEVICE) clear_bit(SDHI_INTERNAL_DMAC_RX_IN_USE, &global_flags); + return true; +} + +static void renesas_sdhi_internal_dmac_complete_tasklet_fn(unsigned long arg) +{ + struct tmio_mmc_host *host = (struct tmio_mmc_host *)arg; + + spin_lock_irq(&host->lock); + if (!renesas_sdhi_internal_dmac_complete(host)) + goto out; + tmio_mmc_do_data_irq(host); out: spin_unlock_irq(&host->lock); -- 2.25.1