summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Reid <preid@electromag.com.au>2016-12-22 17:18:12 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-08-06 18:59:45 -0700
commit14e5c8c61791d03e69de94affc149dcb6735aa66 (patch)
treebe6afe4c72b1ac612ab337b6f2435304afe623ea
parented788dc6fa65f74a5f82f9fe5d7ea46d17cdaf87 (diff)
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>
-rw-r--r--drivers/spi/spi-dw.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/spi/spi-dw.c b/drivers/spi/spi-dw.c
index 27960e46135d..c4226c07e091 100644
--- a/drivers/spi/spi-dw.c
+++ b/drivers/spi/spi-dw.c
@@ -107,7 +107,10 @@ static const struct file_operations dw_spi_regs_ops = {
static int dw_spi_debugfs_init(struct dw_spi *dws)
{
- dws->debugfs = debugfs_create_dir("dw_spi", NULL);
+ char name[128];
+
+ snprintf(name, 128, "dw_spi-%s", dev_name(&dws->master->dev));
+ dws->debugfs = debugfs_create_dir(name, NULL);
if (!dws->debugfs)
return -ENOMEM;