Received: by 10.192.165.156 with SMTP id m28csp702100imm; Thu, 19 Apr 2018 06:14:42 -0700 (PDT) X-Google-Smtp-Source: AIpwx48N+UJzPjWWVjjJX/nTjcHTEOm61uKCkYd9Z3WwuLWDUZpg+LWQTtBwHC8F6CkW8mutYAig X-Received: by 10.101.68.205 with SMTP id g13mr5008330pgs.387.1524143682565; Thu, 19 Apr 2018 06:14:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524143682; cv=none; d=google.com; s=arc-20160816; b=rSpLyorvKteYNZOQzNvqHWNbJnHJ6L9S9rZThGZYIWO86tnv6gT99SP/uWCvC/sX7N 5cm38iZ7yYpKL7YzpxuGk+Z+/Qnq8bwE4ulFLFAbFmhw97H8ZP/I2GsbNEQCiEjW9MLL oVtAdE7cJaKfEhOB2IvHHf6JaJEoFqNcNyy3Rgtadws7QozcYdTTl6hBshGYThr8kFLf pc+mUVy4yWXTzmFtjVkdtVOt+zrHY694WtSNHBdtIzliskNTdCvF0e1+oZJ8l8y26zxl MgwyZeXilq5PDNlRpa58MlKtCrQ4DuSoa4CTFFVXUR+L1jjhKvzfYJoppNG2fvC3rbvz OfCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date :arc-authentication-results; bh=R5rndUaIjwfuAPu1rsBRzilq9VEw59x0T+8bdjF65fs=; b=YCAXL62+imPHOcqGYmbRlCYmafwY3qLbJX1QFYS9/lv3N5TqB2Ih0XB8f0Y5m6dT/m vyZsFr23Bvz5/GDsxiR2Gbpo34AvCjgfyiHrLOyNbgooYoCKGgvtgre/A/5b+sHOOqEM UcPNFbPNxUM/xXecmbeE4BA3Ftah2heumZ6QylbOwskKG8a3vqtQKg9B+Z36mRXc1J+0 E7jWl7hsrz3K9MEgkfK2Vh7fIxImtlWrkJQlCL1EK7PAJOEBqHikK3feOYzfmJS3lQtZ 6Bcws2gh+IlwO13Zg26wPFDMmZvaOyj/VbN+X9Pu8VcUH4bTq73R2j/B/BKhtoP/uEAB C2mA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y12-v6si3347402plt.175.2018.04.19.06.14.28; Thu, 19 Apr 2018 06:14:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752757AbeDSNM5 (ORCPT + 99 others); Thu, 19 Apr 2018 09:12:57 -0400 Received: from agrajag.zerfleddert.de ([88.198.237.222]:55596 "EHLO agrajag.zerfleddert.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752597AbeDSNMz (ORCPT ); Thu, 19 Apr 2018 09:12:55 -0400 X-Greylist: delayed 536 seconds by postgrey-1.27 at vger.kernel.org; Thu, 19 Apr 2018 09:12:55 EDT Received: by agrajag.zerfleddert.de (Postfix, from userid 1000) id 54F355B20689; Thu, 19 Apr 2018 15:03:58 +0200 (CEST) Date: Thu, 19 Apr 2018 15:03:58 +0200 From: Stefan Potyra To: Mark Brown , Florian Fainelli , bcm-kernel-feedback-list@broadcom.com, linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: ldv-project@linuxtesting.org, sil2review@lists.osadl.org Subject: [PATCH] Enable the clock before calling clk_get_rate(). Message-ID: <20180419130358.r7dva6owy2izyfus@agrajag.zerfleddert.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Found by Linux Driver Verification project (linuxtesting.org). Fixes: 142168eba9dc spi: bcm63xx-hsspi: add bcm63xx HSSPI driver Signed-off-by: Stefan Potyra --- drivers/spi/spi-bcm63xx-hsspi.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-bcm63xx-hsspi.c b/drivers/spi/spi-bcm63xx-hsspi.c index cbcba614b253..46cd9b683d22 100644 --- a/drivers/spi/spi-bcm63xx-hsspi.c +++ b/drivers/spi/spi-bcm63xx-hsspi.c @@ -352,6 +352,10 @@ static int bcm63xx_hsspi_probe(struct platform_device *pdev) if (IS_ERR(clk)) return PTR_ERR(clk); + ret = clk_prepare_enable(clk); + if (ret) + return ret; + rate = clk_get_rate(clk); if (!rate) { struct clk *pll_clk = devm_clk_get(dev, "pll"); @@ -364,10 +368,6 @@ static int bcm63xx_hsspi_probe(struct platform_device *pdev) return -EINVAL; } - ret = clk_prepare_enable(clk); - if (ret) - return ret; - master = spi_alloc_master(&pdev->dev, sizeof(*bs)); if (!master) { ret = -ENOMEM; -- 2.17.0