From patchwork Thu May 3 23:40:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 10379473 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 33B0E6038F for ; Thu, 3 May 2018 23:41:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1F18C292A8 for ; Thu, 3 May 2018 23:41:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 13E94292AB; Thu, 3 May 2018 23:41:21 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id ACB25292A8 for ; Thu, 3 May 2018 23:41:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Date:Message-Id: In-Reply-To:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: References:List-Owner; bh=0GIVekBahtRnjC2ytrEL4bGOpVXrJ1bIDqeZ9tw3vVw=; b=WDT 5UGCwEnWwytSJS6MMV8oTDRFOgU7ZvYbXPjYZwb0q2w2+R+HY/aYppWif4kJ0ye/PG6RDQvZTLnue NxqY0XfzNE5LywJnUjH6jUIzhAuPystZEwWRCTOuk/OeFkHPq8EADKhonOYmUX8sYmGFulqmA0But YizsjvbGeKxvL+6Tr0L0iQNp9WJW5QTXdbwzLGkctdgklBNhReANj6Cq3EFUVIef0wsROzz9o76lr vK30dquTN+7tLswIUUhm9mC1SXCseX8ZcJOHz3TDYpIdrIL/YX+LgO9SgoMt3x6sQmlUjUJlCDD7T ZyGF04aVZrM7MFLmWlDFJap1zhvP5cQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fENqa-000813-3t; Thu, 03 May 2018 23:41:12 +0000 Received: from heliosphere.sirena.org.uk ([2a01:7e01::f03c:91ff:fed4:a3b6]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fENqV-0007zG-H2 for linux-arm-kernel@lists.infradead.org; Thu, 03 May 2018 23:41:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=V1HqofMrZ4cCw3g2yXGd9S2NgHgGZKn3uLpRk0FnqbE=; b=tGCUWU8cPRd4 ENi/YAi3vCwiXvqmTUOhFXiwhOMDPMIV9Aa/hq2xS7vlsazWVakwsTZyMJRmjUlnPx8JvIPVME44i cX8xDKiEyvYYCWdh7hU34iG1m3ByjlaM0MbS5FCaaqi6jDWOvp+u0UwDiNAuhxOV9v2H1tT2PKO1g Vo9vw=; Received: from [211.55.52.16] (helo=finisterre.ee.mobilebroadband) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1fENqH-0004cm-Rp; Thu, 03 May 2018 23:40:54 +0000 Received: by finisterre.ee.mobilebroadband (Postfix, from userid 1000) id 727DD44007A; Fri, 4 May 2018 00:40:49 +0100 (BST) From: Mark Brown To: Tobias Jordan Subject: Applied "spi: pxa2xx: check clk_prepare_enable() return value" to the spi tree In-Reply-To: <20180430143006.ckcbicijw2to2ghl@agrajag.zerfleddert.de> Message-Id: <20180503234049.727DD44007A@finisterre.ee.mobilebroadband> Date: Fri, 4 May 2018 00:40:49 +0100 (BST) X-Bad-Reply: In-Reply-To but no 'Re:' in Subject. X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180503_164107_713559_63242FDB X-CRM114-Status: GOOD ( 17.14 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, Haojian Zhuang , linux-spi@vger.kernel.org, Mark Brown , Daniel Mack , Robert Jarzmik , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The patch spi: pxa2xx: check clk_prepare_enable() return value has been applied to the spi tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark From 62bbc864d1946c715063bd481bff3641fd1324e2 Mon Sep 17 00:00:00 2001 From: Tobias Jordan Date: Mon, 30 Apr 2018 16:30:06 +0200 Subject: [PATCH] spi: pxa2xx: check clk_prepare_enable() return value clk_prepare_enable() can fail, so its return value should be checked and acted upon. Found by Linux Driver Verification project (linuxtesting.org). Fixes: 3343b7a6d2cd ("spi/pxa2xx: convert to the common clk framework") Signed-off-by: Tobias Jordan Signed-off-by: Mark Brown --- drivers/spi/spi-pxa2xx.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c index 40f1346b8188..0b2d60d30f69 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c @@ -1612,7 +1612,9 @@ static int pxa2xx_spi_probe(struct platform_device *pdev) } /* Enable SOC clock */ - clk_prepare_enable(ssp->clk); + status = clk_prepare_enable(ssp->clk); + if (status) + goto out_error_dma_irq_alloc; master->max_speed_hz = clk_get_rate(ssp->clk); @@ -1716,6 +1718,8 @@ static int pxa2xx_spi_probe(struct platform_device *pdev) pm_runtime_put_noidle(&pdev->dev); pm_runtime_disable(&pdev->dev); clk_disable_unprepare(ssp->clk); + +out_error_dma_irq_alloc: pxa2xx_spi_dma_release(drv_data); free_irq(ssp->irq, drv_data); @@ -1789,8 +1793,11 @@ static int pxa2xx_spi_resume(struct device *dev) int status; /* Enable the SSP clock */ - if (!pm_runtime_suspended(dev)) - clk_prepare_enable(ssp->clk); + if (!pm_runtime_suspended(dev)) { + status = clk_prepare_enable(ssp->clk); + if (status) + return status; + } /* Restore LPSS private register bits */ if (is_lpss_ssp(drv_data)) @@ -1819,9 +1826,10 @@ static int pxa2xx_spi_runtime_suspend(struct device *dev) static int pxa2xx_spi_runtime_resume(struct device *dev) { struct driver_data *drv_data = dev_get_drvdata(dev); + int status; - clk_prepare_enable(drv_data->ssp->clk); - return 0; + status = clk_prepare_enable(drv_data->ssp->clk); + return status; } #endif