From patchwork Wed May 2 09:56:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10375311 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 BEE1F60384 for ; Wed, 2 May 2018 09:57:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AEC1D2852A for ; Wed, 2 May 2018 09:57:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A30872870E; Wed, 2 May 2018 09:57:14 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, 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 16D1A2868D for ; Wed, 2 May 2018 09:57:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750878AbeEBJ5N (ORCPT ); Wed, 2 May 2018 05:57:13 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:39514 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751440AbeEBJ5L (ORCPT ); Wed, 2 May 2018 05:57:11 -0400 Received: by mail-wm0-f67.google.com with SMTP id f8so12708809wmc.4 for ; Wed, 02 May 2018 02:57:10 -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=4b/9vhIazGtNWjNtPKfPm51Cbhq3gOPPsu1HevvzwfA=; b=TzQws12/757J1LnErzD34R/LLOZfYA8bdUbsFlMEWBjXRLJv5OQZ9ByddIQ7fnWbr9 WjXaiutoI6XskaqA5KI0vFW5pRZnzJOBvrrqzGZLoGGuiIfyc/44Xn1qP7cp/gNb7H6o /hchLdgn+Wcj7xijXUHZKTZPF6FnTQ7nIcgzv1paOxUTOzntSAEwshlLH+4Jsu+F3jSM mR+uvctXw4+GCLTKma6DcQyfQS9Z6um2ZZWenR585RebPw90BQrCcItRIhtHvjvIFqOm ToGo1ADi60WVL/wvaU4hPpdIMOiWRb3INDLlZJqtCNCidSL4TVMn8ZxxZ10QO21y2qhJ IyJw== 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=4b/9vhIazGtNWjNtPKfPm51Cbhq3gOPPsu1HevvzwfA=; b=rxNsBu99vVbiNtXerBWZ3o497PZASMzU/3/NXa5BNWMuU//BVeiXos4ybiFkcTw/Yy 6wPLoV1QEn0G2/JeXSVcB+LzSuLJLKGbFuh4uDKIjru0Pp4jfeU6i9Cc157i6JoJJ7gv XHJuzrtsqDTIEGH8cz2lLHzkjzrl5kwoAU4qAexlquT95TbDCvpLGAnu1mLIhocOemUP Xp2aZ4Nvpnq6UpD5zjMdQc9JAg8sAR7s+90Vcjdmvjvv+ghxNfkBVBCJgUIACPsJEV90 WJGx4GQ5vSy57vRJNVUy5PMlC7SInwwqgclOB1M64BxGFuoW3OXCrL+0b3iJBdfPyFF0 9dtg== X-Gm-Message-State: ALQs6tCNEkQMnT4n5nbHdlWNqZP7T2eJ3eHDP4vyZxTcU4z4R6K72p5p rXdk8op+u+VFsIlBDt87KoDsxw== X-Google-Smtp-Source: AB8JxZoSLrOnWCZ13A3ff65kRIPOk8tVVSHocR5OVqEcVrruBbRoKHOUwQO5DkquK8hUtZpD3lq8zg== X-Received: by 10.28.224.6 with SMTP id x6mr11171855wmg.80.1525255029923; Wed, 02 May 2018 02:57:09 -0700 (PDT) Received: from brgl-bgdev.baylibre.local ([90.63.244.31]) by smtp.gmail.com with ESMTPSA id 2-v6sm13722861wrb.22.2018.05.02.02.57.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 May 2018 02:57:09 -0700 (PDT) From: Bartosz Golaszewski To: Ohad Ben-Cohen , Bjorn Andersson , Sekhar Nori , David Lechner , Suman Anna , Aparna Balasubramanian , Kevin Hilman Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH 1/3] remoteproc/davinci: add the missing retval check for clk_enable() Date: Wed, 2 May 2018 11:56:57 +0200 Message-Id: <20180502095659.3626-2-brgl@bgdev.pl> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180502095659.3626-1-brgl@bgdev.pl> References: <20180502095659.3626-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 Acked-by: Suman Anna Reviewed-by: David Lechner Reviewed-by: Sekhar Nori --- 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;