From patchwork Tue Jan 14 21:43:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Han Xu X-Patchwork-Id: 1223093 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20170209 header.b=EpHqvBCn; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47y3zr31Gfz9sR1 for ; Wed, 15 Jan 2020 08:50:48 +1100 (AEDT) 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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=FnOjbkqyofumMfwZITDHlS7GZRUtIKzweXIOIq+skZE=; b=EpHqvBCny5spU5NIQzU/iirG+D AZ1HoFZgZVwtEctCVgse9Eu4wcUZEj8V/Oze1RlNjORypMp6VmqynWQfz4AkGcVRVf4+3t+1Pu71v QoRdFek83VP4ccJVsUVxSxKMztZfqFd6nkEMTnBST14fUop82vFEPI/YgOpjCdfbLCQhwRDLlxeoT /yicy5+t0Joho5gDOaCafxWYTdc0gGAVDbrMXvgK9w2Xpfw6XLjiyAPxgtuTBGpZYSqHwMl9ccCKa ya8TxJWdJbf+tJVIs1bWmLSnDFDWbadM9NrkZGT08nAW8tsqkivn1E5+WNnqsuuJjFw94GAQhPY+1 n1NTV1ug==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1irU54-0007PB-8k; Tue, 14 Jan 2020 21:50:34 +0000 Received: from inva021.nxp.com ([92.121.34.21]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1irU2z-0004Ix-IK; Tue, 14 Jan 2020 21:48:27 +0000 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 6EF77201224; Tue, 14 Jan 2020 22:48:22 +0100 (CET) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 6F4B02004FB; Tue, 14 Jan 2020 22:48:16 +0100 (CET) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id E635D402AE; Wed, 15 Jan 2020 05:48:08 +0800 (SGT) From: Han Xu To: vkoul@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com, esben@geanix.com, boris.brezillon@collabora.com Subject: [PATCH 2/6] dmaengine: mxs: add the remove function Date: Wed, 15 Jan 2020 05:43:59 +0800 Message-Id: <1579038243-28550-3-git-send-email-han.xu@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1579038243-28550-1-git-send-email-han.xu@nxp.com> References: <1579038243-28550-1-git-send-email-han.xu@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200114_134825_738052_3206F47D X-CRM114-Status: UNSURE ( 7.31 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [92.121.34.21 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, linux-imx@nxp.com, dmaengine@vger.kernel.org, han.xu@nxp.com, festevam@gmail.com, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org add the remove function for mxs-dma Signed-off-by: Han Xu --- drivers/dma/mxs-dma.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/dma/mxs-dma.c b/drivers/dma/mxs-dma.c index 9deaaf4fc58f..b458f06f9067 100644 --- a/drivers/dma/mxs-dma.c +++ b/drivers/dma/mxs-dma.c @@ -863,6 +863,22 @@ static int mxs_dma_probe(struct platform_device *pdev) return 0; } +static int mxs_dma_remove(struct platform_device *pdev) +{ + struct mxs_dma_engine *mxs_dma = platform_get_drvdata(pdev); + int i; + + dma_async_device_unregister(&mxs_dma->dma_device); + + for (i = 0; i < MXS_DMA_CHANNELS; i++) { + struct mxs_dma_chan *mxs_chan = &mxs_dma->mxs_chans[i]; + + tasklet_kill(&mxs_chan->tasklet); + } + + return 0; +} + static struct platform_driver mxs_dma_driver = { .driver = { .name = "mxs-dma", @@ -870,6 +886,7 @@ static struct platform_driver mxs_dma_driver = { }, .id_table = mxs_dma_ids, .probe = mxs_dma_probe, + .remove = mxs_dma_remove, }; module_platform_driver(mxs_dma_driver);