Commit fd227816 authored by Dan Carpenter's avatar Dan Carpenter Committed by Krzysztof Kozlowski

memory: emif: Remove bogus debugfs error handling

Callers are generally not supposed to check the return values from
debugfs functions.  Debugfs functions never return NULL so this error
handling will never trigger.  (Historically debugfs functions used to
return a mix of NULL and error pointers but it was eventually deemed too
complicated for something which wasn't intended to be used in normal
situations).

Delete all the error handling.
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Acked-by: default avatarSantosh Shilimkar <ssantosh@kernel.org>
Link: https://lore.kernel.org/r/20200826113759.GF393664@mwandaSigned-off-by: default avatarKrzysztof Kozlowski <krzk@kernel.org>
parent 13d029ee
...@@ -163,35 +163,12 @@ static const struct file_operations emif_mr4_fops = { ...@@ -163,35 +163,12 @@ static const struct file_operations emif_mr4_fops = {
static int __init_or_module emif_debugfs_init(struct emif_data *emif) static int __init_or_module emif_debugfs_init(struct emif_data *emif)
{ {
struct dentry *dentry; emif->debugfs_root = debugfs_create_dir(dev_name(emif->dev), NULL);
int ret; debugfs_create_file("regcache_dump", S_IRUGO, emif->debugfs_root, emif,
&emif_regdump_fops);
dentry = debugfs_create_dir(dev_name(emif->dev), NULL); debugfs_create_file("mr4", S_IRUGO, emif->debugfs_root, emif,
if (!dentry) { &emif_mr4_fops);
ret = -ENOMEM;
goto err0;
}
emif->debugfs_root = dentry;
dentry = debugfs_create_file("regcache_dump", S_IRUGO,
emif->debugfs_root, emif, &emif_regdump_fops);
if (!dentry) {
ret = -ENOMEM;
goto err1;
}
dentry = debugfs_create_file("mr4", S_IRUGO,
emif->debugfs_root, emif, &emif_mr4_fops);
if (!dentry) {
ret = -ENOMEM;
goto err1;
}
return 0; return 0;
err1:
debugfs_remove_recursive(emif->debugfs_root);
err0:
return ret;
} }
static void __exit emif_debugfs_exit(struct emif_data *emif) static void __exit emif_debugfs_exit(struct emif_data *emif)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment