From patchwork Thu Apr 19 13:03:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Potyra, Stefan" X-Patchwork-Id: 10350019 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 7624F60231 for ; Thu, 19 Apr 2018 13:12:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 65C20205F8 for ; Thu, 19 Apr 2018 13:12:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 59E272893C; Thu, 19 Apr 2018 13:12:58 +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=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DD2DD205F8 for ; Thu, 19 Apr 2018 13:12:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752671AbeDSNM4 (ORCPT ); Thu, 19 Apr 2018 09:12:56 -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-Disposition: inline User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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;