Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933947AbcKDAK5 (ORCPT ); Thu, 3 Nov 2016 20:10:57 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:50690 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933919AbcKDAKy (ORCPT ); Thu, 3 Nov 2016 20:10:54 -0400 DMARC-Filter: OpenDMARC Filter v1.3.1 smtp.codeaurora.org D6CE361503 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=pass smtp.mailfrom=spjoshi@codeaurora.org From: Sarangdhar Joshi To: Andy Gross , David Brown Cc: Sarangdhar Joshi , linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Andersson , Jordan Crouse , Stephen Boyd , Trilok Soni Subject: [PATCH v2 3/3] firmware: qcom: scm: Return PTR_ERR when devm_clk_get fails Date: Thu, 3 Nov 2016 17:10:37 -0700 Message-Id: <1478218237-1737-4-git-send-email-spjoshi@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1478218237-1737-1-git-send-email-spjoshi@codeaurora.org> References: <1478218237-1737-1-git-send-email-spjoshi@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1197 Lines: 33 When devm_clk_get fails for core clock, the failure was ignored and the core_clk was explicitly set to NULL so that other remaining clocks can be queried. However, now that we have a cleaner way of expressing the clock dependency, return failure when devm_clk_get fails for core clock. Signed-off-by: Sarangdhar Joshi --- drivers/firmware/qcom_scm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/firmware/qcom_scm.c b/drivers/firmware/qcom_scm.c index 844e90d..0321a26 100644 --- a/drivers/firmware/qcom_scm.c +++ b/drivers/firmware/qcom_scm.c @@ -395,10 +395,10 @@ static int qcom_scm_probe(struct platform_device *pdev) if (clks & SCM_HAS_CORE_CLK) { scm->core_clk = devm_clk_get(&pdev->dev, "core"); if (IS_ERR(scm->core_clk)) { - if (PTR_ERR(scm->core_clk) == -EPROBE_DEFER) - return PTR_ERR(scm->core_clk); - - scm->core_clk = NULL; + if (PTR_ERR(scm->core_clk) != -EPROBE_DEFER) + dev_err(&pdev->dev, + "failed to acquire core clk\n"); + return PTR_ERR(scm->core_clk); } } -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project