From patchwork Sat Oct 29 00:08:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sarangdhar Joshi X-Patchwork-Id: 9402863 X-Patchwork-Delegate: agross@codeaurora.org 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 4F32860231 for ; Sat, 29 Oct 2016 00:09:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3E4D52A8CB for ; Sat, 29 Oct 2016 00:09:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 32F762A8E7; Sat, 29 Oct 2016 00:09:51 +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 677B72A8CB for ; Sat, 29 Oct 2016 00:09:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761548AbcJ2AJO (ORCPT ); Fri, 28 Oct 2016 20:09:14 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:45062 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758181AbcJ2AJM (ORCPT ); Fri, 28 Oct 2016 20:09:12 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id AFD0F615F0; Sat, 29 Oct 2016 00:09:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1477699751; bh=t7rbCeJXdXdC69EULLoWrjlp4SuLbhtfjFSXz0WjVsI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n+RdOa1Nnz7nKOnzgtWVQ1Ybjh8fGI4wtQYPR7rTQI4IvZf60XDjcA6FuLw05dtcC 3BJLgM56VsBTEAKp5Hx9czV9h0c7YN1gHJjymy8XcTXJLhiObVlnHbu+hU+4uMY2Qz D8LBDY+G08EeG5QT5XQpG4nu6KX0w3eWyGj4MFSw= Received: from spjoshi-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: spjoshi@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 12BC861416; Sat, 29 Oct 2016 00:09:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1477699751; bh=t7rbCeJXdXdC69EULLoWrjlp4SuLbhtfjFSXz0WjVsI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n+RdOa1Nnz7nKOnzgtWVQ1Ybjh8fGI4wtQYPR7rTQI4IvZf60XDjcA6FuLw05dtcC 3BJLgM56VsBTEAKp5Hx9czV9h0c7YN1gHJjymy8XcTXJLhiObVlnHbu+hU+4uMY2Qz D8LBDY+G08EeG5QT5XQpG4nu6KX0w3eWyGj4MFSw= DMARC-Filter: OpenDMARC Filter v1.3.1 smtp.codeaurora.org 12BC861416 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 3/3] firmware: qcom: scm: Return PTR_ERR when devm_clk_get fails Date: Fri, 28 Oct 2016 17:08:49 -0700 Message-Id: <1477699729-18451-4-git-send-email-spjoshi@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1477699729-18451-1-git-send-email-spjoshi@codeaurora.org> References: <1477699729-18451-1-git-send-email-spjoshi@codeaurora.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 clean 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 010a350..5c472da 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); } }