summaryrefslogtreecommitdiffstats
path: root/drivers/staging/pi433/pi433_if.c
diff options
context:
space:
mode:
authorMarcin Ciupak <marcin.s.ciupak@gmail.com>2017-11-21 00:05:50 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-11-28 14:11:00 +0100
commit99ee477425c490d92d5824bdf7c1132c226765f4 (patch)
treeea1fae14da80e867d00b2d4d69805badc12b80bf /drivers/staging/pi433/pi433_if.c
parentd2cb4845bfd1213e49a30682cec18c8825140153 (diff)
downloadop-kernel-dev-99ee477425c490d92d5824bdf7c1132c226765f4.zip
op-kernel-dev-99ee477425c490d92d5824bdf7c1132c226765f4.tar.gz
staging: pi433: fix naming when more than one radio is used
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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/pi433/pi433_if.c')
-rw-r--r--drivers/staging/pi433/pi433_if.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c
index c9b5a56..3e8e62b 100644
--- a/drivers/staging/pi433/pi433_if.c
+++ b/drivers/staging/pi433/pi433_if.c
@@ -1111,7 +1111,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);
@@ -1127,7 +1128,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;
OpenPOWER on IntegriCloud