From patchwork Tue May 12 13:45:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 11543243 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E6715913 for ; Tue, 12 May 2020 13:44:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CF1212078A for ; Tue, 12 May 2020 13:44:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="VXJCifCA" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729336AbgELNow (ORCPT ); Tue, 12 May 2020 09:44:52 -0400 Received: from fllv0016.ext.ti.com ([198.47.19.142]:35754 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726891AbgELNow (ORCPT ); Tue, 12 May 2020 09:44:52 -0400 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 04CDilHQ038964; Tue, 12 May 2020 08:44:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1589291087; bh=XS2QD0LFM42f8K406v4BRe7RKue43uRrXgihFnYHjn0=; h=From:To:CC:Subject:Date; b=VXJCifCAQrxdF/CSLbVnhEV/ktzxKeDVkxU63tSWXUZHfM8g8yHv5eyrU+rI1MT4A A9in4kq2gn+2jgoU1zzUFW+ZPxvrV0dn60c2BxCrCVqRhT+dhSdx2c9/75a1Q4tO1Z SvkQtPTEh6j0ncMf5pWK6ynQpjUJmZud5lqxUILc= Received: from DLEE105.ent.ti.com (dlee105.ent.ti.com [157.170.170.35]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 04CDilI0058113 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 12 May 2020 08:44:47 -0500 Received: from DLEE115.ent.ti.com (157.170.170.26) by DLEE105.ent.ti.com (157.170.170.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Tue, 12 May 2020 08:44:46 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE115.ent.ti.com (157.170.170.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Tue, 12 May 2020 08:44:46 -0500 Received: from feketebors.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 04CDij5e085845; Tue, 12 May 2020 08:44:45 -0500 From: Peter Ujfalusi To: CC: , Subject: [PATCH] dmaengine: ti: k3-udma: Use proper return code in alloc_chan_resources Date: Tue, 12 May 2020 16:45:19 +0300 Message-ID: <20200512134519.5642-1-peter.ujfalusi@ti.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org In udma_alloc_chan_resources() if the channel is not willing to stop then the function should return with error code. Signed-off-by: Peter Ujfalusi --- drivers/dma/ti/k3-udma.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/dma/ti/k3-udma.c b/drivers/dma/ti/k3-udma.c index 0a041747fb21..89d025a5c599 100644 --- a/drivers/dma/ti/k3-udma.c +++ b/drivers/dma/ti/k3-udma.c @@ -1870,6 +1870,7 @@ static int udma_alloc_chan_resources(struct dma_chan *chan) udma_stop(uc); if (udma_is_chan_running(uc)) { dev_err(ud->dev, "chan%d: won't stop!\n", uc->id); + ret = -EBUSY; goto err_res_free; } }