mirror of
https://github.com/torvalds/linux.git
synced 2026-05-12 16:18:45 +02:00
spi: amlogic-spisg: Use IS_ERR() instead of IS_ERR_OR_NULL()
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> Link: https://patch.msgid.link/20260308-spisg-1-v1-1-4e209faf228d@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
869d5b4b2a
commit
8abf84f76a
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user