Commit 14e5c8c61791d03e69de94affc149dcb6735aa66

Authored by Phil Reid
Committed by Greg Kroah-Hartman
1 parent ed788dc6fa

spi: dw: Make debugfs name unique between instances

[ Upstream commit 13288bdf4adbaa6bd1267f10044c1bc25d90ce7f ]

Some system have multiple dw devices. Currently the driver uses a
fixed name for the debugfs dir. Append dev name to the debugfs dir
name to make it unique.

Signed-off-by: Phil Reid <preid@electromag.com.au>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Showing 1 changed file with 4 additions and 1 deletions Side-by-side Diff

drivers/spi/spi-dw.c
... ... @@ -107,7 +107,10 @@
107 107  
108 108 static int dw_spi_debugfs_init(struct dw_spi *dws)
109 109 {
110   - dws->debugfs = debugfs_create_dir("dw_spi", NULL);
  110 + char name[128];
  111 +
  112 + snprintf(name, 128, "dw_spi-%s", dev_name(&dws->master->dev));
  113 + dws->debugfs = debugfs_create_dir(name, NULL);
111 114 if (!dws->debugfs)
112 115 return -ENOMEM;
113 116