Commit 54eedf0b authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman Committed by Herbert Xu

crypto: ccree - 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: Yael Chemla <yael.chemla@foss.arm.com>
Cc: Gilad Ben-Yossef <gilad@benyossef.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: linux-crypto@vger.kernel.org
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-By: default avatarGilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent f0fcf9ad
...@@ -39,11 +39,9 @@ static struct debugfs_reg32 debug_regs[] = { ...@@ -39,11 +39,9 @@ static struct debugfs_reg32 debug_regs[] = {
CC_DEBUG_REG(AXIM_MON_COMP), CC_DEBUG_REG(AXIM_MON_COMP),
}; };
int __init cc_debugfs_global_init(void) void __init cc_debugfs_global_init(void)
{ {
cc_debugfs_dir = debugfs_create_dir("ccree", NULL); cc_debugfs_dir = debugfs_create_dir("ccree", NULL);
return !cc_debugfs_dir;
} }
void __exit cc_debugfs_global_fini(void) void __exit cc_debugfs_global_fini(void)
...@@ -56,7 +54,6 @@ int cc_debugfs_init(struct cc_drvdata *drvdata) ...@@ -56,7 +54,6 @@ int cc_debugfs_init(struct cc_drvdata *drvdata)
struct device *dev = drvdata_to_dev(drvdata); struct device *dev = drvdata_to_dev(drvdata);
struct cc_debugfs_ctx *ctx; struct cc_debugfs_ctx *ctx;
struct debugfs_regset32 *regset; struct debugfs_regset32 *regset;
struct dentry *file;
debug_regs[0].offset = drvdata->sig_offset; debug_regs[0].offset = drvdata->sig_offset;
debug_regs[1].offset = drvdata->ver_offset; debug_regs[1].offset = drvdata->ver_offset;
...@@ -74,22 +71,9 @@ int cc_debugfs_init(struct cc_drvdata *drvdata) ...@@ -74,22 +71,9 @@ int cc_debugfs_init(struct cc_drvdata *drvdata)
regset->base = drvdata->cc_base; regset->base = drvdata->cc_base;
ctx->dir = debugfs_create_dir(drvdata->plat_dev->name, cc_debugfs_dir); ctx->dir = debugfs_create_dir(drvdata->plat_dev->name, cc_debugfs_dir);
if (!ctx->dir)
return -ENFILE;
file = debugfs_create_regset32("regs", 0400, ctx->dir, regset);
if (!file) {
debugfs_remove(ctx->dir);
return -ENFILE;
}
file = debugfs_create_bool("coherent", 0400, ctx->dir, debugfs_create_regset32("regs", 0400, ctx->dir, regset);
&drvdata->coherent); debugfs_create_bool("coherent", 0400, ctx->dir, &drvdata->coherent);
if (!file) {
debugfs_remove_recursive(ctx->dir);
return -ENFILE;
}
drvdata->debugfs = ctx; drvdata->debugfs = ctx;
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#define __CC_DEBUGFS_H__ #define __CC_DEBUGFS_H__
#ifdef CONFIG_DEBUG_FS #ifdef CONFIG_DEBUG_FS
int cc_debugfs_global_init(void); void cc_debugfs_global_init(void);
void cc_debugfs_global_fini(void); void cc_debugfs_global_fini(void);
int cc_debugfs_init(struct cc_drvdata *drvdata); int cc_debugfs_init(struct cc_drvdata *drvdata);
...@@ -13,11 +13,7 @@ void cc_debugfs_fini(struct cc_drvdata *drvdata); ...@@ -13,11 +13,7 @@ void cc_debugfs_fini(struct cc_drvdata *drvdata);
#else #else
static inline int cc_debugfs_global_init(void) static inline void cc_debugfs_global_init(void) {}
{
return 0;
}
static inline void cc_debugfs_global_fini(void) {} static inline void cc_debugfs_global_fini(void) {}
static inline int cc_debugfs_init(struct cc_drvdata *drvdata) static inline int cc_debugfs_init(struct cc_drvdata *drvdata)
......
...@@ -538,13 +538,8 @@ static struct platform_driver ccree_driver = { ...@@ -538,13 +538,8 @@ static struct platform_driver ccree_driver = {
static int __init ccree_init(void) static int __init ccree_init(void)
{ {
int ret;
cc_hash_global_init(); cc_hash_global_init();
cc_debugfs_global_init();
ret = cc_debugfs_global_init();
if (ret)
return ret;
return platform_driver_register(&ccree_driver); return platform_driver_register(&ccree_driver);
} }
......
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