From patchwork Fri Mar 30 15:28:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10317859 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 95E4460212 for ; Fri, 30 Mar 2018 15:29:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 83B6F2A5BE for ; Fri, 30 Mar 2018 15:29:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 750252A5D9; Fri, 30 Mar 2018 15:29:44 +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 F088C2A5BE for ; Fri, 30 Mar 2018 15:29:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752290AbeC3P3N (ORCPT ); Fri, 30 Mar 2018 11:29:13 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:34867 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751433AbeC3P3G (ORCPT ); Fri, 30 Mar 2018 11:29:06 -0400 Received: by mail-wm0-f68.google.com with SMTP id r82so17402088wme.0 for ; Fri, 30 Mar 2018 08:29:06 -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=I8pGhEjfAxAfF2CZaXKXR4H2MjLvLZ4lynYaksKe5YI=; b=DuRubhNLZg6r4W3N99lNgtEch5xixnDwe3juqCf66qH2B2E1KO/1AqwHQYtNwOZ7Lp Av9pVJBsWjDUM1cO+09HlqwwTwVXkG657izUgNtV756OgkU2/fJpPaZ2g5OOopyx4TxT XyKhiCAVVXNtp4ncpkhGpXGOpcb9YQQlY3IduvX/ooeBSWq4xOk+uyNTO3kr6MwU5m2y +SgPxPRIudJ8RQqrvwlgVCWeuYTF8DsezgUalrU5aICIlNK/aTm3+Qk0849Y2iLuKEY+ mD/Jjilc5n2RfGA1atL/FrL3iVezql6pAYnc8215BkC6cnw8VpZ+o26GSvlJHcNav5nG 8dgw== 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=I8pGhEjfAxAfF2CZaXKXR4H2MjLvLZ4lynYaksKe5YI=; b=rnzBVW4VCGFj6YawsxBhfmDLlNbtqLwZ1G+HBS+E2Lup77a68Nkoq1ERL5eIH7K6Nc 4hJVh3vJTm2GYwc+K319aAJS+cBWgsOq/QGGQS4Mvq6JXhAmH5UYxN6QMYut/Ktx+6O/ hF+vGzuk31ADHBOgqkewtdq/KuMB+AD3Xr77ytz08QPQR9nFa9ok6K21iLReUYvuLJFU b6koJo0dB2re3QrnMR831JbyqI7Q85qZjWuDQPkjGp5afxuIGPEmfaY7Vczcy+JzGFiJ zRYrmp0NwFabJwrTX/7P5FIxpab5HhjQvThAtllw2yLhxoHFacjlLXdkWuvH6jOn/Yb9 bXDw== X-Gm-Message-State: AElRT7GURxKwxjo7TaDIJQrDwNlc3xQ89+H+C4ioWgmAcp9v8qakCkeh O+wjoluHCc17AkIi3Q2CXnR9vA== X-Google-Smtp-Source: AIpwx4+786dOm9dN+pQK2woKBujJP+y8tk5dbCuN/pATcEZSDFIIIy02O4JTK2EYj2SieiY+E9VUpQ== X-Received: by 10.28.177.215 with SMTP id a206mr2567249wmf.142.1522423745689; Fri, 30 Mar 2018 08:29:05 -0700 (PDT) Received: from brgl-bgdev.baylibre.local ([90.63.244.31]) by smtp.gmail.com with ESMTPSA id n49sm14429881wrn.90.2018.03.30.08.29.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Mar 2018 08:29:05 -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 v5 4/8] remoteproc/davinci: add the missing retval check for clk_enable() Date: Fri, 30 Mar 2018 17:28:52 +0200 Message-Id: <20180330152856.12297-5-brgl@bgdev.pl> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180330152856.12297-1-brgl@bgdev.pl> References: <20180330152856.12297-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 --- 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;