From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753148AbdKTV50 (ORCPT ); Mon, 20 Nov 2017 16:57:26 -0500 Received: from mail-lf0-f67.google.com ([209.85.215.67]:33449 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752932AbdKTV5Y (ORCPT ); Mon, 20 Nov 2017 16:57:24 -0500 X-Google-Smtp-Source: AGs4zMZPdN7sRG7fFyaLvWRm4KIcghPGSWbj5/vDQLtGAid+I3s56IfXDEscimgarhmatqqEJASLrw== Date: Tue, 21 Nov 2017 00:05:50 +0100 From: Marcin Ciupak To: Greg Kroah-Hartman 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 Message-ID: <816efe02d72bd845a7654fa86ab2a5d78d1064de.1511218324.git.marcin.s.ciupak@gmail.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20171013 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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