From patchwork Sat Aug 20 12:57:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 12949702 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 926D7C25B08 for ; Sat, 20 Aug 2022 13:17:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=DuXnOmtxgNP3E7OQvOlFkXqCXemiftL+6PDFIkJlNFU=; b=N0bzroE2bKDklc lNGDbeAhSTzXvHfZ0GDUP0z0l3PRRcRKgwzlfBhC8/Xv+I4yCSGQ9IOYMCALgrGJCyuV3BZi5eExD E2KSL+LWycpLEHl7Cp2gqGUUsWc+qMwsImrNJoE90p4nV9XfSKQkF+q+2wqpNS7uz5EAIBKyxAnIK HQU7/0gXgbF+/YbTBKiyIgqTxTC7K9OiTkiuNWDilT1Lg/OshQ2trTiiDkUOkY/HTIcup3aT7ecY3 Q3lHgOd2tHEg+SmlxbZGFL3CQItqpIf+RyyXOYctszcUgRXYO71b5Vp+hEaL21mpf52L0tPsxULRg RwHglhsZcs/1j2Bhx0og==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oPOKc-00ALFC-Og; Sat, 20 Aug 2022 13:16:06 +0000 Received: from esa.microchip.iphmx.com ([68.232.153.233]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oPO44-00ACxw-T8 for linux-arm-kernel@lists.infradead.org; Sat, 20 Aug 2022 12:59:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1661000340; x=1692536340; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=nDyvtjdoUQ/ZE1kaAzbregn+LZl7wiMtfm/LN75pW6M=; b=gOnfhM7xACHZT/d9Fi8r69ZItsuYQshL1QadqLiUZJ7wzN5VMaXbFvHv crzNUGOjgPglUeWikS/0uMmKluQni9iqB2UTUMtZhNrHWNUxE0/mcgwI4 iForr5YnkXh09Fw7WYURz85D6zL2vv4Ki267uz+zFXgUh/JK26mBBL2QH 3tm5vwWmk9h0GyIx5ZXTaewdpSXHRJG4rxriUhkwFafg1O3gN/jkRRP9P X9inlO+Qiz4flMemH05p2/Vt6ytt8a/cBgmC5o1Pi0XHw6Ogqw8VIRuXp YcOJi0r0ToHewARw1f9U6fW/BJ0l4leXhuPbhzsLA/go4aAbkAtMBOgRg Q==; X-IronPort-AV: E=Sophos;i="5.93,251,1654585200"; d="scan'208";a="187325871" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 20 Aug 2022 05:58:59 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.12; Sat, 20 Aug 2022 05:58:59 -0700 Received: from ROB-ULT-M18064N.mchp-main.com (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2507.12 via Frontend Transport; Sat, 20 Aug 2022 05:58:56 -0700 From: Tudor Ambarus To: , , , Subject: [PATCH 28/33] dmaengine: at_hdmac: Use devm_request_irq() Date: Sat, 20 Aug 2022 15:57:12 +0300 Message-ID: <20220820125717.588722-29-tudor.ambarus@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220820125717.588722-1-tudor.ambarus@microchip.com> References: <20220820125717.588722-1-tudor.ambarus@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220820_055901_026770_9360313E X-CRM114-Status: GOOD ( 11.33 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: tudor.ambarus@microchip.com, linux-kernel@vger.kernel.org, maciej.sosnowski@intel.com, mripard@kernel.org, torfl6749@gmail.com, ludovic.desroches@microchip.com, dmaengine@vger.kernel.org, dan.j.williams@intel.com, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org IRQs requested with this function will be automatically freed on driver detach. Use devm_request_irq() and make the code cleaner. Signed-off-by: Tudor Ambarus --- drivers/dma/at_hdmac.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c index 9c414f167b62..96b885f83374 100644 --- a/drivers/dma/at_hdmac.c +++ b/drivers/dma/at_hdmac.c @@ -2241,6 +2241,10 @@ static int __init at_dma_probe(struct platform_device *pdev) irq = platform_get_irq(pdev, 0); if (irq < 0) return irq; + err = devm_request_irq(&pdev->dev, irq, at_dma_interrupt, 0, + dev_name(&pdev->dev), atdma); + if (err) + return err; /* discover transaction capabilities */ atdma->dma_device.cap_mask = plat_dat->cap_mask; @@ -2257,10 +2261,6 @@ static int __init at_dma_probe(struct platform_device *pdev) /* force dma off, just in case */ at_dma_off(atdma); - err = request_irq(irq, at_dma_interrupt, 0, "at_hdmac", atdma); - if (err) - goto err_irq; - platform_set_drvdata(pdev, atdma); /* create a pool of consistent memory blocks for hardware descriptors */ @@ -2377,8 +2377,6 @@ static int __init at_dma_probe(struct platform_device *pdev) err_memset_pool_create: dma_pool_destroy(atdma->dma_desc_pool); err_desc_pool_create: - free_irq(platform_get_irq(pdev, 0), atdma); -err_irq: clk_disable_unprepare(atdma->clk); err_clk_prepare: clk_put(atdma->clk); @@ -2397,7 +2395,6 @@ static int at_dma_remove(struct platform_device *pdev) dma_pool_destroy(atdma->memset_pool); dma_pool_destroy(atdma->dma_desc_pool); - free_irq(platform_get_irq(pdev, 0), atdma); list_for_each_entry_safe(chan, _chan, &atdma->dma_device.channels, device_node) {