From patchwork Thu Dec 12 13:55:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 181486 Delivered-To: patch@linaro.org Received: by 2002:ac9:44c4:0:0:0:0:0 with SMTP id t4csp802408och; Thu, 12 Dec 2019 05:56:13 -0800 (PST) X-Google-Smtp-Source: APXvYqzWan1Ss1M6A5M0jX/7gvrXHu5q+/WwJ+OdJtNM4qTIVxAZFRaVJbR04eEHrtN0ocvcVAvg X-Received: by 2002:a9d:53cb:: with SMTP id i11mr8575650oth.158.1576158973308; Thu, 12 Dec 2019 05:56:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576158973; cv=none; d=google.com; s=arc-20160816; b=eQrT7LW/jYqhTFzwaVvo0IawZFg1zXlnDLHf2PzM6flnsOU5dSF2JEl/Us25u/mId+ i9YwnbDEo+MvStVBdiUZ+0xwSkFAdyWCu7NZtIpjWHDyJXIyZq72+IZ2mtEuic4DI0dW PHrF/9zfarbq5EG8UZxf2lbZRErqhblWGhurooIULN7mkp8jHeEkNdrE+QP6yUH9gazx gE19cCt9yZ1wKzYx8w7xDWXV6QBBHYuEtOCZh+Py6OhcodOHvFjWb7e+dxXKTlI/K/jE gXi2Ys0MivaKhxfGnVgTOJsxqD/NJ6tRl2aIdcABVCgMYRAGULU3lPA4Ho10/xNYAOil ta1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=/VjfGP3WRkp95PceeWAWMC/LGOv+vDTnn9JLhZJ8NM4=; b=dg12u2Q98yoVh/yIYvwjzuHjBa6ny9vKMQ9n60Do/1Mgz3Y++9Cq5uN9Gdafw9pr1o lPGumrP8BqPdYIpwYyCwAUc1DT+o1Td7If306wRNNjDplTe78mgqF872UfAIhRa0E89z bY6O528wNx8ToJMFtvBH0fvzj/6qjY6ayoDICBEzjEEmvWmzYCywXIQsniOzAShAmwEG Nlvtbc5MhWaWM1/+CPBLRrF3fH9Ykalgn09c/oee7C2wGyeNvFTjxU8FE2t7eyENBCi+ vPlJxEnpW6ip4KtL8U958jkUVjFIzRb/ISED7sfWDVGTzO6mYRzK3nLfuNjVVghU5ya/ qIZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=ABuTfH8H; spf=pass (google.com: best guess record for domain of linux-spi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-spi-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d17si3407189otp.315.2019.12.12.05.56.13; Thu, 12 Dec 2019 05:56:13 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-spi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=ABuTfH8H; spf=pass (google.com: best guess record for domain of linux-spi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-spi-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729578AbfLLN4L (ORCPT + 2 others); Thu, 12 Dec 2019 08:56:11 -0500 Received: from lelv0143.ext.ti.com ([198.47.23.248]:40770 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729485AbfLLN4F (ORCPT ); Thu, 12 Dec 2019 08:56:05 -0500 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id xBCDtqSw063125; Thu, 12 Dec 2019 07:55:52 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1576158952; bh=/VjfGP3WRkp95PceeWAWMC/LGOv+vDTnn9JLhZJ8NM4=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=ABuTfH8HNFdORfuhcBqXcsaqeQmzQvcV/Q9Ok0dDxOkbf2JsUpcFq8HtX/18ok+Jf LFENwjNTmAr+Cxw6xLoZNRLgucxKnqGfma3cSum7Hy/8pLl1Vu/FWwSuCWPFI+0BIC 4I3eQPPF5PNOJciIP6uCEwew1yiihdZgUhhXS6+g= Received: from DFLE103.ent.ti.com (dfle103.ent.ti.com [10.64.6.24]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTP id xBCDtqeb116351; Thu, 12 Dec 2019 07:55:52 -0600 Received: from DFLE110.ent.ti.com (10.64.6.31) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3; Thu, 12 Dec 2019 07:55:51 -0600 Received: from lelv0326.itg.ti.com (10.180.67.84) by DFLE110.ent.ti.com (10.64.6.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3 via Frontend Transport; Thu, 12 Dec 2019 07:55:51 -0600 Received: from feketebors.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id xBCDtdqS048444; Thu, 12 Dec 2019 07:55:48 -0600 From: Peter Ujfalusi To: , , , , , , , , , CC: , , , , , Subject: [PATCH 2/9] spi: bcm2835: Release the DMA channel if probe fails after dma_init Date: Thu, 12 Dec 2019 15:55:43 +0200 Message-ID: <20191212135550.4634-3-peter.ujfalusi@ti.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191212135550.4634-1-peter.ujfalusi@ti.com> References: <20191212135550.4634-1-peter.ujfalusi@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org The DMA channel was not released if either devm_request_irq() or devm_spi_register_controller() failed. Signed-off-by: Peter Ujfalusi --- drivers/spi/spi-bcm2835.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -- Peter Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c index fb61a620effc..662d55e9f21d 100644 --- a/drivers/spi/spi-bcm2835.c +++ b/drivers/spi/spi-bcm2835.c @@ -1327,20 +1327,22 @@ static int bcm2835_spi_probe(struct platform_device *pdev) dev_name(&pdev->dev), ctlr); if (err) { dev_err(&pdev->dev, "could not request IRQ: %d\n", err); - goto out_clk_disable; + goto out_dma_release; } err = devm_spi_register_controller(&pdev->dev, ctlr); if (err) { dev_err(&pdev->dev, "could not register SPI controller: %d\n", err); - goto out_clk_disable; + goto out_dma_release; } bcm2835_debugfs_create(bs, dev_name(&pdev->dev)); return 0; +out_dma_release: + bcm2835_dma_release(ctlr, bs); out_clk_disable: clk_disable_unprepare(bs->clk); out_controller_put: