From mboxrd@z Thu Jan 1 00:00:00 1970 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 EBA9FC25B08 for ; Sat, 20 Aug 2022 13:18:53 +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=/QPhYZwNRp6KIUn9+zSE2h1w3IyqRy/if4yxz9Pt/E0=; b=qenKs031gktzb4 RGDPm7Zf2QIpNkkSZ04jW/vbpFR7Ws82rrVPAvNp5NWsqAtc9Ejb7AFLo22EixhiZ7WWTPC0PMMpH tWDLJvQRoz6P6nEGLkeWw5qfBZ0phvZqvLsPvslc7ek4B8aA9BN5zTMxt4arDIIK5UaYKKoVeIKKa NattwjsyavVebI9Roa36hfCN3ESWJG4ahQawXjPHiaHHTDJCJt4nKN0axuzH5bb0ZXTZ+/WfAjJOu 3TeGMb2AbB0feg2/hhaqP82JBrMixqlyUslCR0jl4uf/HqKIUXCWWXUYi7pWOZGDAUxyRqk1YqRs0 9+jqv3Sef7AaFQeX9zEA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oPOMF-00ALy2-Sm; Sat, 20 Aug 2022 13:17:48 +0000 Received: from esa.microchip.iphmx.com ([68.232.154.123]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oPO4E-00AD2i-F8 for linux-arm-kernel@lists.infradead.org; Sat, 20 Aug 2022 12:59:12 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1661000350; x=1692536350; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=+YvybVBwNlRymwG1fxaRQyE2wDdutvaCQCMO9iy144c=; b=FLpVzbooPWdFnkn4Racglif8nnoeP504NKssv18sJVw+dnot6vdr16FK tjogEtE4ENRUE72RNvANyrH+DDl2ougswSNsWx1+bElrDT/tytc2sNwyd 8NNq2jOnqTvUeVpcbKM9ZJXedDaOAkhHiY20zbyDtJdN7ZcqIgS3lvFmf Ll2efw9dyq8j7Rki3cjpWjnuwA5wqiqiQZLRu77H6snlh8cISFk4CYB4n fJ2vM2/O05662+TMiUxNOnB24A+VRjUUWSE90M0YGaIEwx4AJjHW8bb5E x3i2Yse7PchN2jlZTI3WVSe7s3hzwV4HRkfd98miG34OG0acZPHKynIBx w==; X-IronPort-AV: E=Sophos;i="5.93,251,1654585200"; d="scan'208";a="109911987" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 20 Aug 2022 05:59:09 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex03.mchp-main.com (10.10.85.151) 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:59:06 -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:59:03 -0700 From: Tudor Ambarus To: , , , Subject: [PATCH 30/33] dmaengine: at_hdmac: Check return code of dma_async_device_register Date: Sat, 20 Aug 2022 15:57:14 +0300 Message-ID: <20220820125717.588722-31-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_055910_666215_D4A43FB5 X-CRM114-Status: GOOD ( 11.70 ) 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org dma_async_device_register() can fail, check the return code and display an error. Signed-off-by: Tudor Ambarus --- drivers/dma/at_hdmac.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c index 042c7cba74bb..0b473e6d161d 100644 --- a/drivers/dma/at_hdmac.c +++ b/drivers/dma/at_hdmac.c @@ -2353,7 +2353,11 @@ static int __init at_dma_probe(struct platform_device *pdev) dma_has_cap(DMA_SLAVE, atdma->dma_device.cap_mask) ? "slave " : "", plat_dat->nr_channels); - dma_async_device_register(&atdma->dma_device); + err = dma_async_device_register(&atdma->dma_device); + if (err) { + dev_err(&pdev->dev, "Unable to register: %d.\n", err); + goto err_dma_async_device_register; + } /* * Do not return an error if the dmac node is not present in order to @@ -2373,6 +2377,7 @@ static int __init at_dma_probe(struct platform_device *pdev) err_of_dma_controller_register: dma_async_device_unregister(&atdma->dma_device); +err_dma_async_device_register: dma_pool_destroy(atdma->memset_pool); err_memset_pool_create: dma_pool_destroy(atdma->dma_desc_pool); -- 2.25.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel