Skip to content

Commit 0178f1e

Browse files
osmtenbroonie
authored andcommitted
spi-dw-core.c: Fix error checking for debugfs_create_dir
This patch fixes the error checking in spi-dw-core.c in debugfs_create_dir. The DebugFS kernel API is developed in a way that the caller can safely ignore the errors that occur during the creation of DebugFS nodes. Signed-off-by: Osama Muhammad <osmtendev@gmail.com> Link: https://lore.kernel.org/r/20230520224025.14928-1-osmtendev@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 81ea9a0 commit 0178f1e

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

drivers/spi/spi-dw-core.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,21 +57,18 @@ static const struct debugfs_reg32 dw_spi_dbgfs_regs[] = {
5757
DW_SPI_DBGFS_REG("RX_SAMPLE_DLY", DW_SPI_RX_SAMPLE_DLY),
5858
};
5959

60-
static int dw_spi_debugfs_init(struct dw_spi *dws)
60+
static void dw_spi_debugfs_init(struct dw_spi *dws)
6161
{
6262
char name[32];
6363

6464
snprintf(name, 32, "dw_spi%d", dws->master->bus_num);
6565
dws->debugfs = debugfs_create_dir(name, NULL);
66-
if (!dws->debugfs)
67-
return -ENOMEM;
6866

6967
dws->regset.regs = dw_spi_dbgfs_regs;
7068
dws->regset.nregs = ARRAY_SIZE(dw_spi_dbgfs_regs);
7169
dws->regset.base = dws->regs;
7270
debugfs_create_regset32("registers", 0400, dws->debugfs, &dws->regset);
7371

74-
return 0;
7572
}
7673

7774
static void dw_spi_debugfs_remove(struct dw_spi *dws)
@@ -80,9 +77,8 @@ static void dw_spi_debugfs_remove(struct dw_spi *dws)
8077
}
8178

8279
#else
83-
static inline int dw_spi_debugfs_init(struct dw_spi *dws)
80+
static inline void dw_spi_debugfs_init(struct dw_spi *dws)
8481
{
85-
return 0;
8682
}
8783

8884
static inline void dw_spi_debugfs_remove(struct dw_spi *dws)

0 commit comments

Comments
 (0)