linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Phil Reid <preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org>
To: broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	kernel-NoMTM8u0nx3R7s880joybQ@public.gmane.org,
	preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org,
	linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [PATCH v2 1/1] spi: dw: Make debugfs name unique between instances
Date: Tue,  3 Jan 2017 12:54:09 +0800	[thread overview]
Message-ID: <1483419249-88956-1-git-send-email-preid@electromag.com.au> (raw)

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

Signed-off-by: Phil Reid <preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org>
---

Notes:
    Changes from v1:
    - Reduce buffer size to 32.
    - Use bus_num instead of device name.

 drivers/spi/spi-dw.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/spi-dw.c b/drivers/spi/spi-dw.c
index 27960e4..77439ac 100644
--- a/drivers/spi/spi-dw.c
+++ b/drivers/spi/spi-dw.c
@@ -107,7 +107,10 @@ static ssize_t dw_spi_show_regs(struct file *file, char __user *user_buf,
 
 static int dw_spi_debugfs_init(struct dw_spi *dws)
 {
-	dws->debugfs = debugfs_create_dir("dw_spi", NULL);
+	char name[32];
+
+	snprintf(name, 32, "dw_spi%d", dws->master->bus_num);
+	dws->debugfs = debugfs_create_dir(name, NULL);
 	if (!dws->debugfs)
 		return -ENOMEM;
 
-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

             reply	other threads:[~2017-01-03  4:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-03  4:54 Phil Reid [this message]
     [not found] ` <1483419249-88956-1-git-send-email-preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org>
2017-01-03 23:02   ` [PATCH v2 1/1] spi: dw: Make debugfs name unique between instances Andy Shevchenko
     [not found]     ` <CAHp75Vc=h1eepd3DYEiSxP_vG1CS+FyKijmEYtw8Td7dj_VZOw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-01-03 23:05       ` Andy Shevchenko
     [not found]         ` <CAHp75VfeX+9b2bEt9VdNrOX9+jbqfvXx8rk=K2FJsoghRoxQJA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-01-04  2:21           ` Phil Reid
     [not found]             ` <ea4998f7-e55c-884e-cb4d-5533c7104dd7-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org>
2017-01-04  9:06               ` Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1483419249-88956-1-git-send-email-preid@electromag.com.au \
    --to=preid-qgqnfa1juf/o2in0hyhwsidd74u8msao@public.gmane.org \
    --cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=kernel-NoMTM8u0nx3R7s880joybQ@public.gmane.org \
    --cc=linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).