From patchwork Tue Dec 17 20:42:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Gorski X-Patchwork-Id: 3365261 X-Patchwork-Delegate: broonie@sirena.org.uk Return-Path: X-Original-To: patchwork-linux-spi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 436F29F37A for ; Tue, 17 Dec 2013 20:43:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 83796203AE for ; Tue, 17 Dec 2013 20:43:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B5522203B4 for ; Tue, 17 Dec 2013 20:43:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753817Ab3LQUnR (ORCPT ); Tue, 17 Dec 2013 15:43:17 -0500 Received: from arrakis.dune.hu ([78.24.191.176]:54940 "EHLO arrakis.dune.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753740Ab3LQUnQ (ORCPT ); Tue, 17 Dec 2013 15:43:16 -0500 Received: from localhost (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 587CC2800A9; Tue, 17 Dec 2013 21:40:59 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Virus-Scanned: at arrakis.dune.hu Received: from shaker64.lan (dslb-088-073-137-004.pools.arcor-ip.net [88.73.137.4]) by arrakis.dune.hu (Postfix) with ESMTPSA id 1268C28A904; Tue, 17 Dec 2013 21:40:49 +0100 (CET) From: Jonas Gorski To: linux-spi@vger.kernel.org Cc: Mark Brown , Maxime Bizon , Florian Fainelli , Kevin Cernekee Subject: [PATCH 3/4] spi/bcm63xx: check return value of clk_prepare_enable Date: Tue, 17 Dec 2013 21:42:09 +0100 Message-Id: <1387312930-22436-4-git-send-email-jogo@openwrt.org> X-Mailer: git-send-email 1.8.5.1 In-Reply-To: <1387312930-22436-1-git-send-email-jogo@openwrt.org> References: <1387312930-22436-1-git-send-email-jogo@openwrt.org> 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 Ensure we notice if the clock cannot be enabled for any reason and pass the error down. Signed-off-by: Jonas Gorski --- drivers/spi/spi-bcm63xx.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-bcm63xx.c b/drivers/spi/spi-bcm63xx.c index ae60731..0c8c68a 100644 --- a/drivers/spi/spi-bcm63xx.c +++ b/drivers/spi/spi-bcm63xx.c @@ -397,7 +397,10 @@ static int bcm63xx_spi_probe(struct platform_device *pdev) } /* Initialize hardware */ - clk_prepare_enable(bs->clk); + ret = clk_prepare_enable(bs->clk); + if (ret) + goto out_err; + bcm_spi_writeb(bs, SPI_INTR_CLEAR_ALL, SPI_INT_STATUS); /* register and we are done */ @@ -450,8 +453,11 @@ static int bcm63xx_spi_resume(struct device *dev) { struct spi_master *master = dev_get_drvdata(dev); struct bcm63xx_spi *bs = spi_master_get_devdata(master); + int ret; - clk_prepare_enable(bs->clk); + ret = clk_prepare_enable(bs->clk); + if (ret) + return ret; spi_master_resume(master);