summaryrefslogtreecommitdiff
path: root/drivers/watchdog
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-06-18 18:58:30 +0300
committerWim Van Sebroeck <wim@linux-watchdog.org>2019-07-08 21:35:10 +0300
commit64079cf9f2b2f93779c1d9772d0e1f5c04bd4d22 (patch)
treea476c42ad987556dde8f0f26b4e40ee476cd6982 /drivers/watchdog
parent1dbb3bb8de88dbca78556684e79a0f10f7da3d00 (diff)
downloadlinux-64079cf9f2b2f93779c1d9772d0e1f5c04bd4d22.tar.xz
watchdog: mei_wdt: no need to check return value of debugfs_create functions
When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this. Cc: Tomas Winkler <tomas.winkler@intel.com> Cc: Wim Van Sebroeck <wim@linux-watchdog.org> Cc: Guenter Roeck <linux@roeck-us.net> Cc: linux-watchdog@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
Diffstat (limited to 'drivers/watchdog')
-rw-r--r--drivers/watchdog/mei_wdt.c30
1 files changed, 7 insertions, 23 deletions
diff --git a/drivers/watchdog/mei_wdt.c b/drivers/watchdog/mei_wdt.c
index 099f6305039d..5391bf3e6b11 100644
--- a/drivers/watchdog/mei_wdt.c
+++ b/drivers/watchdog/mei_wdt.c
@@ -537,38 +537,23 @@ static void dbgfs_unregister(struct mei_wdt *wdt)
wdt->dbgfs_dir = NULL;
}
-static int dbgfs_register(struct mei_wdt *wdt)
+static void dbgfs_register(struct mei_wdt *wdt)
{
- struct dentry *dir, *f;
+ struct dentry *dir;
dir = debugfs_create_dir(KBUILD_MODNAME, NULL);
- if (!dir)
- return -ENOMEM;
-
wdt->dbgfs_dir = dir;
- f = debugfs_create_file("state", S_IRUSR, dir, wdt, &dbgfs_fops_state);
- if (!f)
- goto err;
- f = debugfs_create_file("activation", S_IRUSR,
- dir, wdt, &dbgfs_fops_activation);
- if (!f)
- goto err;
+ debugfs_create_file("state", S_IRUSR, dir, wdt, &dbgfs_fops_state);
- return 0;
-err:
- dbgfs_unregister(wdt);
- return -ENODEV;
+ debugfs_create_file("activation", S_IRUSR, dir, wdt,
+ &dbgfs_fops_activation);
}
#else
static inline void dbgfs_unregister(struct mei_wdt *wdt) {}
-
-static inline int dbgfs_register(struct mei_wdt *wdt)
-{
- return 0;
-}
+static inline void dbgfs_register(struct mei_wdt *wdt) {}
#endif /* CONFIG_DEBUG_FS */
static int mei_wdt_probe(struct mei_cl_device *cldev,
@@ -621,8 +606,7 @@ static int mei_wdt_probe(struct mei_cl_device *cldev,
if (ret)
goto err_disable;
- if (dbgfs_register(wdt))
- dev_warn(&cldev->dev, "cannot register debugfs\n");
+ dbgfs_register(wdt);
return 0;