[PATCH] FMC: fix 'passing zero to PTR_ERR()' warning
From: Ding Xiang
Date: Thu Jun 20 2019 - 06:16:53 EST
Fix a static code checker warning:
drivers/fmc/fmc-debug.c:155
fmc_debug_init() warn: passing zero to 'PTR_ERR'
Signed-off-by: Ding Xiang <dingxiang@xxxxxxxxxxxxxxxxxxxx>
---
drivers/fmc/fmc-debug.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/fmc/fmc-debug.c b/drivers/fmc/fmc-debug.c
index 1734c7c..dd33951 100644
--- a/drivers/fmc/fmc-debug.c
+++ b/drivers/fmc/fmc-debug.c
@@ -152,7 +152,7 @@ int fmc_debug_init(struct fmc_device *fmc)
fmc->dbg_dir = debugfs_create_dir(dev_name(&fmc->dev), NULL);
if (IS_ERR_OR_NULL(fmc->dbg_dir)) {
pr_err("FMC: Cannot create debugfs\n");
- return PTR_ERR(fmc->dbg_dir);
+ return PTR_ERR_OR_ZERO(fmc->dbg_dir);
}
fmc->dbg_sdb_dump = debugfs_create_file(FMC_DBG_SDB_DUMP, 0444,
--
1.9.1