From: Marcin Ciupak <marcin.s.ciupak@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org
Subject: [PATCH 2/2] staging: pi433: fix naming when more than one radio is used
Date: Tue, 21 Nov 2017 00:05:50 +0100 [thread overview]
Message-ID: <816efe02d72bd845a7654fa86ab2a5d78d1064de.1511218324.git.marcin.s.ciupak@gmail.com> (raw)
In-Reply-To: <cover.1511218323.git.marcin.s.ciupak@gmail.com>
When using more than one hardware radio module pi433_probe fails as the
same name is used for all modules. Create unique name by adding minor
number to the device name.
Signed-off-by: Marcin Ciupak <marcin.s.ciupak@gmail.com>
---
drivers/staging/pi433/pi433_if.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c
index bc17676169cb..7a3e3101c483 100644
--- a/drivers/staging/pi433/pi433_if.c
+++ b/drivers/staging/pi433/pi433_if.c
@@ -1172,7 +1172,8 @@ static int pi433_probe(struct spi_device *spi)
&spi->dev,
device->devt,
device,
- "pi433");
+ "pi433.%d",
+ device->minor);
if (IS_ERR(device->dev)) {
pr_err("pi433: device register failed\n");
retval = PTR_ERR(device->dev);
@@ -1188,7 +1189,8 @@ static int pi433_probe(struct spi_device *spi)
/* start tx thread */
device->tx_task_struct = kthread_run(pi433_tx_thread,
device,
- "pi433_tx_task");
+ "pi433.%d_tx_task",
+ device->minor);
if (IS_ERR(device->tx_task_struct)) {
dev_dbg(device->dev, "start of send thread failed");
goto send_thread_failed;
--
2.15.0
prev parent reply other threads:[~2017-11-20 21:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-20 23:02 [PATCH 0/2] staging: pi433: fix logging and naming issues Marcin Ciupak
2017-11-20 23:03 ` [PATCH 1/2] staging: pi433: fix (NULL device *) in log message Marcin Ciupak
2017-11-20 23:05 ` Marcin Ciupak [this message]
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=816efe02d72bd845a7654fa86ab2a5d78d1064de.1511218324.git.marcin.s.ciupak@gmail.com \
--to=marcin.s.ciupak@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®