From patchwork Fri Mar 23 09:36:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10303111 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 EC49360385 for ; Fri, 23 Mar 2018 09:38:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DE70028952 for ; Fri, 23 Mar 2018 09:38:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D301228C4A; Fri, 23 Mar 2018 09:38:12 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 26C9A28952 for ; Fri, 23 Mar 2018 09:38:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752188AbeCWJh7 (ORCPT ); Fri, 23 Mar 2018 05:37:59 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:40097 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752186AbeCWJgY (ORCPT ); Fri, 23 Mar 2018 05:36:24 -0400 Received: by mail-wr0-f193.google.com with SMTP id z8so11402004wrh.7 for ; Fri, 23 Mar 2018 02:36:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=U1TfO8aiHw1+4sjUXHFMzAyxiOYHnHiizDs5ufLc9rY=; b=wPy1ZOendHEzjWyHuwOFFKMSaJZvZ5mvk+ObtbZaNsddsc+1PSsBh3RcKq5bFBZ1cx vVPMKCOG1knE7YjrKgRTPKTvlmROdYs0eWeNrsYPOYeeF0upa9F3FvqKNr1DMFzjhnBI QzJjqkM3uGgTgOwk4jepA/5eas1vtCy2iS4UXEv74tb9f+wJl1vrIy05Mzx6WvkJvKAW h3bsM1Hd9o3Klgd5JTeWkvrxHbcC2uFSpwCePPXjlHaFvGWyynOLF7kRirYB8A8i/sOr Enf7s/BMGw8/5DlUHsZcvVtHyfBNtV4iXMAJ8xirEHRG3uBUY2jqoKzdOP8GWOINz335 tsRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=U1TfO8aiHw1+4sjUXHFMzAyxiOYHnHiizDs5ufLc9rY=; b=SqlKbjFDHj41Q7wPDt3jGL4WC1DoA0FTe3wzeWVfLor4Z2BFq1FUtdGR1A5XhgqE9c xB0YYPxDvm+MSfSpe/k8pw/8+gPqkWuW9i8V0XjC5KFR01xFEzNQ4aO9tNO0sCg3BUUJ /TY+yR0W8VU6O3lMtx6F0MOnizOV0nnrI3GriFO1SdcMmn2cwMVSPldu0Ht8ptyYuCbZ wFtdfTPgT0bLxckySqNMI3gcwA1gQxLhyiaE9BKyKhI6QO/JW6fm+Bb1/f++FCL3g7jM XGAE2efxhyDx6XY3b1YEtiwhvcTX9hzOvOE4qLpEVj5YRVyjFfR04Yu8Pfis6N56r6dt 3CCw== X-Gm-Message-State: AElRT7HHknJE6ZbLNTbQjv0iYsay8OGibgrGHQbPL/xLSqQjagmlvKtg 9q5fO6PZ+FWr/k/2OPQrXvQANw== X-Google-Smtp-Source: AG47ELvRt9P/7pw70uGXOCGAL3m76NMqRTBwaBE8eBzexRszvYG5HlkGgUZMpff1qv8+jVw27b9gdA== X-Received: by 10.223.132.103 with SMTP id 94mr21336549wrf.275.1521797783336; Fri, 23 Mar 2018 02:36:23 -0700 (PDT) Received: from brgl-bgdev.lan (LFbn-NIC-1-208-99.w2-15.abo.wanadoo.fr. [2.15.55.99]) by smtp.gmail.com with ESMTPSA id s125sm8045203wmf.4.2018.03.23.02.36.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Mar 2018 02:36:22 -0700 (PDT) From: Bartosz Golaszewski To: Sekhar Nori , Kevin Hilman , Rob Herring , Mark Rutland , Russell King , David Lechner , Michael Turquette , Stephen Boyd , Ohad Ben-Cohen , Bjorn Andersson , Philipp Zabel Cc: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-remoteproc@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH v2 5/8] remoteproc: da8xx: add the missing retval check for clk_enable() Date: Fri, 23 Mar 2018 10:36:06 +0100 Message-Id: <20180323093609.24576-6-brgl@bgdev.pl> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180323093609.24576-1-brgl@bgdev.pl> References: <20180323093609.24576-1-brgl@bgdev.pl> Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Bartosz Golaszewski The davinci platform is being switched to using the common clock framework, where clk_enable() can fail. Add the return value check. Signed-off-by: Bartosz Golaszewski --- drivers/remoteproc/da8xx_remoteproc.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/remoteproc/da8xx_remoteproc.c b/drivers/remoteproc/da8xx_remoteproc.c index bf3b9034c319..2b24291337b7 100644 --- a/drivers/remoteproc/da8xx_remoteproc.c +++ b/drivers/remoteproc/da8xx_remoteproc.c @@ -138,6 +138,7 @@ static int da8xx_rproc_start(struct rproc *rproc) struct device *dev = rproc->dev.parent; struct da8xx_rproc *drproc = (struct da8xx_rproc *)rproc->priv; struct clk *dsp_clk = drproc->dsp_clk; + int ret; /* hw requires the start (boot) address be on 1KB boundary */ if (rproc->bootaddr & 0x3ff) { @@ -148,7 +149,12 @@ static int da8xx_rproc_start(struct rproc *rproc) writel(rproc->bootaddr, drproc->bootreg); - clk_enable(dsp_clk); + ret = clk_enable(dsp_clk); + if (ret) { + dev_err(dev, "clk_enable() failed: %d\n", ret); + return ret; + } + davinci_clk_reset_deassert(dsp_clk); return 0;