From patchwork Wed Mar 21 12:08:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10299287 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 12D84602B3 for ; Wed, 21 Mar 2018 12:09:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 122732982F for ; Wed, 21 Mar 2018 12:09:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 068E329832; Wed, 21 Mar 2018 12:09:52 +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 ADFAE2982F for ; Wed, 21 Mar 2018 12:09:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752007AbeCUMJV (ORCPT ); Wed, 21 Mar 2018 08:09:21 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:33366 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751657AbeCUMIe (ORCPT ); Wed, 21 Mar 2018 08:08:34 -0400 Received: by mail-wm0-f66.google.com with SMTP id i189so6084809wmf.0 for ; Wed, 21 Mar 2018 05:08:33 -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=/jgc8KvKidUt160wr/sjSOu4TyEA2gVnQ8oAmfrKh/8=; b=wPLUZhdaheg2HN1fK1wWh7KwsoRZE1jG90hfCDzRLKwfXgP4iTM4G7IrKlI+LyxhpZ YTzl4vpXKuKTkFBH7UIFvHmBjIQZ540htC6RrvKrlBgt/4FZwGJSM+T5TtQJnCWZDXOq aG4Yppw+XjhDIeM81P5V8oH716NPuJgIfHV6h6MWES4wyh+8g/bnuKXawwXYxBrU/IeA xvM9aKioLchsAFhycxkTB2vtrqg09kJyFi5DFVt4+KOsUoSoK5pIBZEkmBPJHawt443k VPQWqPOZKdZtlNWNbzsVwrMUmn4VgiTG1CDDDXf4fZrHzHnk+SU85Jtno+OYkWkykciV qn4Q== 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=/jgc8KvKidUt160wr/sjSOu4TyEA2gVnQ8oAmfrKh/8=; b=qsKGvyxSe8pke12tLm5f4D7dEvUclkOr8apdtl3Du5OAxO1clC395Pjki0fpd2eN27 NyjnnOs1/WQd5FxD4fkIpBHqcBOVbUc+AvlTxSCQF/cOIdKEqPINdWNAiIcTZFnbeTXw CGzrHqgW5xkM1+w+uzdE4OuwqvvcN0/Veg2xg5jjLfV/IU8HfsN1xU9UnJasxCNiuiXx wPW5YmpKnWartIHpMzqHXSRDHt5tzElrjc79hBUWVQYU4DG3Ht2/klHjo00KnL3m3rka 0XrLt33sy/vZOlC4VusXEW4OAcoJlGCb5DFDTPe9P7wj43CYdhIkG5/xORFE4L91SRPU 0WnA== X-Gm-Message-State: AElRT7HLUGzHCtVqQt//FuWJk97yQLtE21rI2bVM8a2YqIro8zk9m1lb GCr8Yxz6eqlu2yaJV2IVmepTPg== X-Google-Smtp-Source: AG47ELubidwFSrZKXgRDds3rbwWIcm3wX8oBsGeq/J0d+BOYANry9pdrxcLBbtn37hMIV57gKfo3RQ== X-Received: by 10.28.0.88 with SMTP id 85mr2368014wma.63.1521634113088; Wed, 21 Mar 2018 05:08:33 -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 69sm3871018wmp.36.2018.03.21.05.08.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Mar 2018 05:08:32 -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 5/8] remoteproc: da8xx: add the missing checke for clk_enable() Date: Wed, 21 Mar 2018 13:08:04 +0100 Message-Id: <20180321120807.18032-6-brgl@bgdev.pl> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180321120807.18032-1-brgl@bgdev.pl> References: <20180321120807.18032-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..592bf0fc52e8 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 rv; /* 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); + rv = clk_enable(dsp_clk); + if (rv) { + dev_err(dev, "clk_enable() failed: %d\n", rv); + return rv; + } + davinci_clk_reset_deassert(dsp_clk); return 0;