mirror of
https://github.com/torvalds/linux.git
synced 2024-11-23 12:42:02 +00:00
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
This commit is contained in:
parent
f2156989bf
commit
120e1aa2f2
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user