summaryrefslogtreecommitdiff
path: root/drivers/spi/spi-hisi-kunpeng.c
diff options
context:
space:
mode:
authorYeqi Fu <asuk4.q@gmail.com>2023-05-18 13:25:15 +0800
committerMark Brown <broonie@kernel.org>2023-05-18 19:26:36 +0900
commit120e1aa2f2e60b55f9d20c2fe1c6144739e00dc4 (patch)
tree868dd07981f5060116a697af324e23e7550d1321 /drivers/spi/spi-hisi-kunpeng.c
parentf2156989bf3014c67707d73ccd202b2ada09080b (diff)
downloadlwn-120e1aa2f2e60b55f9d20c2fe1c6144739e00dc4.tar.gz
lwn-120e1aa2f2e60b55f9d20c2fe1c6144739e00dc4.zip
spi: hisi-kunpeng: Fix error checking
The function debugfs_create_dir returns ERR_PTR if an error occurs, and the appropriate way to verify for errors is to use the inline function IS_ERR. The patch will substitute the null-comparison with IS_ERR. Suggested-by: Ivan Orlov <ivan.orlov0322@gmail.com Signed-off-by: Yeqi Fu <asuk4.q@gmail.com Link: https://lore.kernel.org/r/20230518052515.368978-1-asuk4.q@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org
Diffstat (limited to 'drivers/spi/spi-hisi-kunpeng.c')
-rw-r--r--drivers/spi/spi-hisi-kunpeng.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/spi/spi-hisi-kunpeng.c b/drivers/spi/spi-hisi-kunpeng.c
index 524eadbef87b..2b4b3d2a22b8 100644
--- a/drivers/spi/spi-hisi-kunpeng.c
+++ b/drivers/spi/spi-hisi-kunpeng.c
@@ -169,7 +169,7 @@ static int hisi_spi_debugfs_init(struct hisi_spi *hs)
master = container_of(hs->dev, struct spi_controller, dev);
snprintf(name, 32, "hisi_spi%d", master->bus_num);
hs->debugfs = debugfs_create_dir(name, NULL);
- if (!hs->debugfs)
+ if (IS_ERR(hs->debugfs))
return -ENOMEM;
hs->regset.regs = hisi_spi_regs;