From: Felix Gu <ustc.gu@gmail.com>
To: Sunny Luo <sunny.luo@amlogic.com>,
Xianwei Zhao <xianwei.zhao@amlogic.com>,
Mark Brown <broonie@kernel.org>
Cc: linux-amlogic@lists.infradead.org, linux-spi@vger.kernel.org,
linux-kernel@vger.kernel.org, Felix Gu <ustc.gu@gmail.com>
Subject: [PATCH] spi: amlogic-spisg: Use IS_ERR() instead of IS_ERR_OR_NULL()
Date: Sun, 08 Mar 2026 14:59:50 +0800 [thread overview]
Message-ID: <20260308-spisg-1-v1-1-4e209faf228d@gmail.com> (raw)
devm_clk_get_enabled() and devm_clk_hw_get_clk() return error pointers
on failure and never return NULL. So IS_ERR_OR_NULL() is unnecessary,
replace them with IS_ERR().
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
---
drivers/spi/spi-amlogic-spisg.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/spi/spi-amlogic-spisg.c b/drivers/spi/spi-amlogic-spisg.c
index 1509df2b17ae..665f889dc8d3 100644
--- a/drivers/spi/spi-amlogic-spisg.c
+++ b/drivers/spi/spi-amlogic-spisg.c
@@ -647,13 +647,13 @@ static int aml_spisg_clk_init(struct spisg_device *spisg, void __iomem *base)
int ret, i;
spisg->core = devm_clk_get_enabled(dev, "core");
- if (IS_ERR_OR_NULL(spisg->core)) {
+ if (IS_ERR(spisg->core)) {
dev_err(dev, "core clock request failed\n");
return PTR_ERR(spisg->core);
}
spisg->pclk = devm_clk_get_enabled(dev, "pclk");
- if (IS_ERR_OR_NULL(spisg->pclk)) {
+ if (IS_ERR(spisg->pclk)) {
dev_err(dev, "pclk clock request failed\n");
return PTR_ERR(spisg->pclk);
}
@@ -703,7 +703,7 @@ static int aml_spisg_clk_init(struct spisg_device *spisg, void __iomem *base)
}
spisg->sclk = devm_clk_hw_get_clk(dev, &div->hw, NULL);
- if (IS_ERR_OR_NULL(spisg->sclk)) {
+ if (IS_ERR(spisg->sclk)) {
dev_err(dev, "get clock failed\n");
return PTR_ERR(spisg->sclk);
}
---
base-commit: a0ae2a256046c0c5d3778d1a194ff2e171f16e5f
change-id: 20260308-spisg-1-f342db88b67c
Best regards,
--
Felix Gu <ustc.gu@gmail.com>
next reply other threads:[~2026-03-08 6:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-08 6:59 Felix Gu [this message]
2026-03-16 1:16 ` [PATCH] spi: amlogic-spisg: Use IS_ERR() instead of IS_ERR_OR_NULL() Mark Brown
2026-03-16 17:52 ` Mark Brown
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=20260308-spisg-1-v1-1-4e209faf228d@gmail.com \
--to=ustc.gu@gmail.com \
--cc=broonie@kernel.org \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=sunny.luo@amlogic.com \
--cc=xianwei.zhao@amlogic.com \
/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