watchdog: bcm_kona_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: Wim Van Sebroeck <wim@linux-watchdog.org> Cc: Florian Fainelli <f.fainelli@gmail.com> Cc: Ray Jui <rjui@broadcom.com> Cc: Scott Branden <sbranden@broadcom.com> Cc: bcm-kernel-feedback-list@broadcom.com Cc: linux-watchdog@vger.kernel.org Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Родитель
1012592cce
Коммит
8bff68b809
|
@ -143,24 +143,18 @@ static void bcm_kona_wdt_debug_init(struct platform_device *pdev)
|
||||||
wdt->debugfs = NULL;
|
wdt->debugfs = NULL;
|
||||||
|
|
||||||
dir = debugfs_create_dir(BCM_KONA_WDT_NAME, NULL);
|
dir = debugfs_create_dir(BCM_KONA_WDT_NAME, NULL);
|
||||||
if (IS_ERR_OR_NULL(dir))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (debugfs_create_file("info", S_IFREG | S_IRUGO, dir, wdt,
|
debugfs_create_file("info", S_IFREG | S_IRUGO, dir, wdt,
|
||||||
&bcm_kona_fops))
|
&bcm_kona_fops);
|
||||||
wdt->debugfs = dir;
|
wdt->debugfs = dir;
|
||||||
else
|
|
||||||
debugfs_remove_recursive(dir);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void bcm_kona_wdt_debug_exit(struct platform_device *pdev)
|
static void bcm_kona_wdt_debug_exit(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct bcm_kona_wdt *wdt = platform_get_drvdata(pdev);
|
struct bcm_kona_wdt *wdt = platform_get_drvdata(pdev);
|
||||||
|
|
||||||
if (wdt && wdt->debugfs) {
|
if (wdt)
|
||||||
debugfs_remove_recursive(wdt->debugfs);
|
debugfs_remove_recursive(wdt->debugfs);
|
||||||
wdt->debugfs = NULL;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
Загрузка…
Ссылка в новой задаче