summaryrefslogtreecommitdiff
path: root/drivers/iio
diff options
context:
space:
mode:
authorYang Ruibin <11162571@vivo.com>2024-08-21 04:39:08 -0400
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2024-08-21 21:32:52 +0100
commitc4b43d8336e52dce6d124e428aa3b71703e62647 (patch)
tree8a11a4b23041248545a16cb62af761c48b7bab7f /drivers/iio
parentd35099d3c60c8a60de2cab909040c35e255cf474 (diff)
drivers:iio:Fix the NULL vs IS_ERR() bug for debugfs_create_dir()
The debugfs_create_dir() function returns error pointers. It never returns NULL. So use IS_ERR() to check it. Signed-off-by: Yang Ruibin <11162571@vivo.com> Link: https://patch.msgid.link/20240821083911.3411-1-11162571@vivo.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio')
-rw-r--r--drivers/iio/industrialio-backend.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/industrialio-backend.c b/drivers/iio/industrialio-backend.c
index a52a6b61c8b5..20b3b5212da7 100644
--- a/drivers/iio/industrialio-backend.c
+++ b/drivers/iio/industrialio-backend.c
@@ -219,7 +219,7 @@ void iio_backend_debugfs_add(struct iio_backend *back,
snprintf(name, sizeof(name), "backend%d", back->idx);
back_d = debugfs_create_dir(name, d);
- if (!back_d)
+ if (IS_ERR(back_d))
return;
if (back->ops->debugfs_reg_access)