Commit 00729fd1 authored by Yeqi Fu's avatar Yeqi Fu Committed by hongrongxuan
Browse files

spi: hisi-kunpeng: Fix error checking

mainline inclusion
from mainline-v6.5-rc1
commit 120e1aa2
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I9QOAJ

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=120e1aa2f2e60b55f9d20c2fe1c6144739e00dc4



-------------------------------------------------------------------

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.

Signed-off-by: default avatarYeqi Fu <asuk4.q@gmail.com>
Link: https://lore.kernel.org/r/20230518052515.368978-1-asuk4.q@gmail.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Signed-off-by: default avatarhongrongxuan <hongrongxuan@huawei.com>
parent e584b6a7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -167,7 +167,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;