From: Yan Zhen <yanzhen@vivo.com>
To: mturquette@baylibre.com, sboyd@kernel.org, andersson@kernel.org
Cc: linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org,
linux-kernel@vger.kernel.org, opensoure.kernel@vivo.com,
Yan Zhen <yanzhen@vivo.com>
Subject: [PATCH v2] clk: qcom: Fix error checking for devm_clk_hw_get_clk()
Date: Mon, 26 Aug 2024 14:17:17 +0800 [thread overview]
Message-ID: <20240826061717.2016126-1-yanzhen@vivo.com> (raw)
The devm_clk_hw_get_clk() function returns error pointers.
It never returns NULL. Update the check accordingly.
Signed-off-by: Yan Zhen <yanzhen@vivo.com>
---
Changes in v2:
- Return PTR_ERR(icd[i].clk) instead of -ENOENT.
drivers/clk/qcom/common.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/clk/qcom/common.c b/drivers/clk/qcom/common.c
index 33cc1f73c69d..5a9e653916ea 100644
--- a/drivers/clk/qcom/common.c
+++ b/drivers/clk/qcom/common.c
@@ -273,8 +273,8 @@ static int qcom_cc_icc_register(struct device *dev,
icd[i].slave_id = desc->icc_hws[i].slave_id;
hws = &desc->clks[desc->icc_hws[i].clk_id]->hw;
icd[i].clk = devm_clk_hw_get_clk(dev, hws, "icc");
- if (!icd[i].clk)
- return dev_err_probe(dev, -ENOENT,
+ if (IS_ERR(icd[i].clk))
+ return dev_err_probe(dev, PTR_ERR(icd[i].clk),
"(%d) clock entry is null\n", i);
icd[i].name = clk_hw_get_name(hws);
}
--
2.34.1
next reply other threads:[~2024-08-26 6:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-26 6:17 Yan Zhen [this message]
2024-08-26 13:00 ` Markus Elfring
2024-08-29 9:02 ` Dmitry Baryshkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240826061717.2016126-1-yanzhen@vivo.com \
--to=yanzhen@vivo.com \
--cc=andersson@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=opensoure.kernel@vivo.com \
--cc=sboyd@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®