mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-08 14:23:19 +00:00
ASoC: fsl: 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. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
7f807f2809
commit
227ab8baa1
@ -1582,9 +1582,7 @@ static int fsl_ssi_probe(struct platform_device *pdev)
|
||||
}
|
||||
}
|
||||
|
||||
ret = fsl_ssi_debugfs_create(&ssi->dbg_stats, dev);
|
||||
if (ret)
|
||||
goto error_asoc_register;
|
||||
fsl_ssi_debugfs_create(&ssi->dbg_stats, dev);
|
||||
|
||||
/* Initially configures SSI registers */
|
||||
fsl_ssi_hw_init(ssi);
|
||||
|
@ -270,7 +270,6 @@ struct device;
|
||||
|
||||
struct fsl_ssi_dbg {
|
||||
struct dentry *dbg_dir;
|
||||
struct dentry *dbg_stats;
|
||||
|
||||
struct {
|
||||
unsigned int rfrc;
|
||||
@ -299,7 +298,7 @@ struct fsl_ssi_dbg {
|
||||
|
||||
void fsl_ssi_dbg_isr(struct fsl_ssi_dbg *ssi_dbg, u32 sisr);
|
||||
|
||||
int fsl_ssi_debugfs_create(struct fsl_ssi_dbg *ssi_dbg, struct device *dev);
|
||||
void fsl_ssi_debugfs_create(struct fsl_ssi_dbg *ssi_dbg, struct device *dev);
|
||||
|
||||
void fsl_ssi_debugfs_remove(struct fsl_ssi_dbg *ssi_dbg);
|
||||
|
||||
@ -312,10 +311,9 @@ static inline void fsl_ssi_dbg_isr(struct fsl_ssi_dbg *stats, u32 sisr)
|
||||
{
|
||||
}
|
||||
|
||||
static inline int fsl_ssi_debugfs_create(struct fsl_ssi_dbg *ssi_dbg,
|
||||
struct device *dev)
|
||||
static inline void fsl_ssi_debugfs_create(struct fsl_ssi_dbg *ssi_dbg,
|
||||
struct device *dev)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void fsl_ssi_debugfs_remove(struct fsl_ssi_dbg *ssi_dbg)
|
||||
|
@ -126,25 +126,15 @@ static int fsl_ssi_stats_show(struct seq_file *s, void *unused)
|
||||
|
||||
DEFINE_SHOW_ATTRIBUTE(fsl_ssi_stats);
|
||||
|
||||
int fsl_ssi_debugfs_create(struct fsl_ssi_dbg *ssi_dbg, struct device *dev)
|
||||
void fsl_ssi_debugfs_create(struct fsl_ssi_dbg *ssi_dbg, struct device *dev)
|
||||
{
|
||||
ssi_dbg->dbg_dir = debugfs_create_dir(dev_name(dev), NULL);
|
||||
if (!ssi_dbg->dbg_dir)
|
||||
return -ENOMEM;
|
||||
|
||||
ssi_dbg->dbg_stats = debugfs_create_file("stats", 0444,
|
||||
ssi_dbg->dbg_dir, ssi_dbg,
|
||||
&fsl_ssi_stats_fops);
|
||||
if (!ssi_dbg->dbg_stats) {
|
||||
debugfs_remove(ssi_dbg->dbg_dir);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
return 0;
|
||||
debugfs_create_file("stats", 0444, ssi_dbg->dbg_dir, ssi_dbg,
|
||||
&fsl_ssi_stats_fops);
|
||||
}
|
||||
|
||||
void fsl_ssi_debugfs_remove(struct fsl_ssi_dbg *ssi_dbg)
|
||||
{
|
||||
debugfs_remove(ssi_dbg->dbg_stats);
|
||||
debugfs_remove(ssi_dbg->dbg_dir);
|
||||
debugfs_remove_recursive(ssi_dbg->dbg_dir);
|
||||
}
|
||||
|
@ -141,17 +141,11 @@ static void audmux_debugfs_init(void)
|
||||
char buf[20];
|
||||
|
||||
audmux_debugfs_root = debugfs_create_dir("audmux", NULL);
|
||||
if (!audmux_debugfs_root) {
|
||||
pr_warning("Failed to create AUDMUX debugfs root\n");
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = 0; i < MX31_AUDMUX_PORT7_SSI_PINS_7 + 1; i++) {
|
||||
snprintf(buf, sizeof(buf), "ssi%lu", i);
|
||||
if (!debugfs_create_file(buf, 0444, audmux_debugfs_root,
|
||||
(void *)i, &audmux_debugfs_fops))
|
||||
pr_warning("Failed to create AUDMUX port %lu debugfs file\n",
|
||||
i);
|
||||
debugfs_create_file(buf, 0444, audmux_debugfs_root,
|
||||
(void *)i, &audmux_debugfs_fops);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user