Skip to content

Commit 120e1aa

Browse files
Yeqi Fubroonie
authored andcommitted
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
1 parent f215698 commit 120e1aa

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/spi/spi-hisi-kunpeng.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ static int hisi_spi_debugfs_init(struct hisi_spi *hs)
169169
master = container_of(hs->dev, struct spi_controller, dev);
170170
snprintf(name, 32, "hisi_spi%d", master->bus_num);
171171
hs->debugfs = debugfs_create_dir(name, NULL);
172-
if (!hs->debugfs)
172+
if (IS_ERR(hs->debugfs))
173173
return -ENOMEM;
174174

175175
hs->regset.regs = hisi_spi_regs;

0 commit comments

Comments
 (0)