From patchwork Fri Mar 23 11:47: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: 10304271 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 1908260386 for ; Fri, 23 Mar 2018 11:48:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0837728DB7 for ; Fri, 23 Mar 2018 11:48:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F0B6528DFC; Fri, 23 Mar 2018 11:48:49 +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 8D94228DB7 for ; Fri, 23 Mar 2018 11:48:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754279AbeCWLsf (ORCPT ); Fri, 23 Mar 2018 07:48:35 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:38603 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754723AbeCWLrV (ORCPT ); Fri, 23 Mar 2018 07:47:21 -0400 Received: by mail-wr0-f194.google.com with SMTP id l8so11825198wrg.5 for ; Fri, 23 Mar 2018 04:47:21 -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=yH56iEKTt7mid2nmsqr4SLtIvCzAC7QFlfLHkV8I5msAtIZEJbR8Z6oxADoZzn8PWi 5+37n8AnjCXhNCWDN3FlTrl7QqCvOsAJrr+MgmQxRrYfKgx3t8Gpe9fgZuQXVd2cUIJx iw0a7Q69TFvIedy7kpiRGL/wEKEvZ+4SkQ42TiI0oUQEFmy8f6YiZIRMPM3FTn1Qf47a 4OeFBvYw2Zrf6+Lsw0XsGz7l5A4gUYEd7+1ZOlZwpveG3JDq0Er9fOvCMu3LdNVIlw7/ 0nZlaKVeXqmhmbqIQBC+zekZhKKCQA9+i6r4nCYlOqaZOWuUWKvh6sMtvpgBPn3xAo9t rA5A== 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=f4r+I58GP4Qn8xHn3dZhevILFUdDn/8D8L4g9g88sgN7Kq0GjhtOS2OUN0qgUoZHT7 gxmT1GtHGDx9yi4KjVebg8mbS9EZ0MGbJGgW22ep4bQOlA7dGhon43zmDBStSHP8pHPV qUxjiP0j6OxHbxeuW+Bu9hkm7BnuHG80lKwW1h4qh16iUMq+VKWeOIcOgNNTDylV62bE jpogmwfXVDgyF1epz+1CQA7n8cG1IpEjSmDmbdLN6LpNaVYkwgKxO8qVd1+qBau8hN6c Uf0FoEskW68BUxtoEOFD98pFE9nigfAwBKVckoaFRS70t5yrNLylxDicDaySGn3hfMML TS7w== X-Gm-Message-State: AElRT7HvSiHCYvKvCU3ZH+mfd9PCc4pjLfOrf32pB384Z7XyaLx37TEi zZAb5pzaC5TvZ2qeWXQO8NVqqN0yGVY= X-Google-Smtp-Source: AG47ELuOukBjQWT7BRAmC6J9IdbYQoufdaAGMMikx6A/QYDbaSoONqNDbGaOVcIw4uQMBjxqvsRNSQ== X-Received: by 10.223.195.116 with SMTP id e49mr22141489wrg.5.1521805640334; Fri, 23 Mar 2018 04:47:20 -0700 (PDT) Received: from brgl-bgdev.lan (LFbn-1-7086-217.w90-116.abo.wanadoo.fr. [90.116.254.217]) by smtp.gmail.com with ESMTPSA id m71sm9394843wmd.6.2018.03.23.04.47.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Mar 2018 04:47:19 -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 v3 5/8] remoteproc: da8xx: add the missing retval check for clk_enable() Date: Fri, 23 Mar 2018 12:47:06 +0100 Message-Id: <20180323114709.20330-6-brgl@bgdev.pl> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180323114709.20330-1-brgl@bgdev.pl> References: <20180323114709.20330-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;