From patchwork Fri Aug 3 07:20:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huang Shijie X-Patchwork-Id: 10554675 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B322A157D for ; Fri, 3 Aug 2018 07:22:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9AC6D286B0 for ; Fri, 3 Aug 2018 07:22:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8E93F2882C; Fri, 3 Aug 2018 07:22:58 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,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 3C107286B0 for ; Fri, 3 Aug 2018 07:22:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732571AbeHCJRy (ORCPT ); Fri, 3 Aug 2018 05:17:54 -0400 Received: from mail.iluvatar.ai ([58.213.90.100]:59014 "EHLO mail.iluvatar.ai" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732327AbeHCJQq (ORCPT ); Fri, 3 Aug 2018 05:16:46 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.iluvatar.ai (Postfix) with ESMTP id 09DEE107081FD; Fri, 3 Aug 2018 15:25:23 +0800 (CST) Received: from mail.iluvatar.ai ([127.0.0.1]) by localhost (mail.iluvatar.ai [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id PH5eJj_AmsQP; Fri, 3 Aug 2018 15:25:22 +0800 (CST) Received: from localhost (localhost [127.0.0.1]) by mail.iluvatar.ai (Postfix) with ESMTP id B45EF14504410; Fri, 3 Aug 2018 15:25:22 +0800 (CST) DKIM-Filter: OpenDKIM Filter v2.9.2 mail.iluvatar.ai B45EF14504410 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iluvatar.ai; s=809B2F8E-810B-11E8-86FD-A0A654EEFFEB; t=1533281122; bh=yokq+J9xdJRpn6yDKc3HUxfNPmMCa2VnExcS/vsCY7w=; h=From:To:Subject:Date:Message-Id; b=bn3pxKbldtgzgkrxXbM6+T5eCBQxBgyBD2QWTFbHX2g87c3jSbQ9fFqu7tBuDhtC5 IAA35li/zyfaFMs5k23G4SAKbeen7wdHD5W1HfzbpGGMMQ3OjW4Rde0pWPInRwxnWS YfJ3myi1YhuN5ecdB3LAhK8eyL9OZSYXJZGC8h0o= X-Virus-Scanned: amavisd-new at iluvatar.ai Received: from mail.iluvatar.ai ([127.0.0.1]) by localhost (mail.iluvatar.ai [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id I1eoUGLO-tVd; Fri, 3 Aug 2018 15:25:22 +0800 (CST) Received: from localhost.localdomain (unknown [180.166.124.10]) by mail.iluvatar.ai (Postfix) with ESMTPSA id B311F107081F7; Fri, 3 Aug 2018 15:25:21 +0800 (CST) From: Huang Shijie To: vkoul@kernel.org Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, dave.jiang@intel.com, radhey.shyam.pandey@xilinx.com, appana.durga.rao@xilinx.com, jmkrzyszt@gmail.com, gomonovych@gmail.com, peter.ujfalusi@ti.com, keescook@chromium.org, horms+renesas@verge.net.au, geert+renesas@glider.be, shawnguo@kernel.org, baoyou.xie@linaro.org, michal.simek@xilinx.com, baohua@kernel.org, ludovic.desroches@microchip.com, linus.walleij@linaro.org, david.brown@linaro.org, Huang Shijie Subject: [PATCH 36/46] dmaengine: k3dma: use dmaenginem_async_device_register to simplify the code Date: Fri, 3 Aug 2018 15:20:06 +0800 Message-Id: <20180803072016.21544-37-sjhuang@iluvatar.ai> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180803072016.21544-1-sjhuang@iluvatar.ai> References: <20180803072016.21544-1-sjhuang@iluvatar.ai> Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use dmaenginem_async_device_register to simplify the code: remove dma_async_device_unregister. remove label of_dma_register_fail Signed-off-by: Huang Shijie --- drivers/dma/k3dma.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/dma/k3dma.c b/drivers/dma/k3dma.c index 6bfa217ed6d0..5d9ab35b982d 100644 --- a/drivers/dma/k3dma.c +++ b/drivers/dma/k3dma.c @@ -902,14 +902,14 @@ static int k3_dma_probe(struct platform_device *op) k3_dma_enable_dma(d, true); - ret = dma_async_device_register(&d->slave); + ret = dmaenginem_async_device_register(&d->slave); if (ret) goto dma_async_register_fail; ret = of_dma_controller_register((&op->dev)->of_node, k3_of_dma_simple_xlate, d); if (ret) - goto of_dma_register_fail; + goto dma_async_register_fail; spin_lock_init(&d->lock); INIT_LIST_HEAD(&d->chan_pending); @@ -919,8 +919,6 @@ static int k3_dma_probe(struct platform_device *op) return 0; -of_dma_register_fail: - dma_async_device_unregister(&d->slave); dma_async_register_fail: clk_disable_unprepare(d->clk); return ret; @@ -931,7 +929,6 @@ static int k3_dma_remove(struct platform_device *op) struct k3_dma_chan *c, *cn; struct k3_dma_dev *d = platform_get_drvdata(op); - dma_async_device_unregister(&d->slave); of_dma_controller_free((&op->dev)->of_node); devm_free_irq(&op->dev, d->irq, d);