linux-fpga.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anatolij Gustschin <agust@denx.de>
To: linux-fpga@vger.kernel.org
Cc: atull@kernel.org, mdf@kernel.org
Subject: [PATCH] fpga: xilinx-spi: Use unique FPGA manager names
Date: Mon, 29 Oct 2018 15:42:22 +0100	[thread overview]
Message-ID: <20181029144222.26927-1-agust@denx.de> (raw)

Currently we have the same FPGA manager name for all registered
xlnx-slave-spi managers, so it is not clear which fpga manager
index belongs to which configuration interface (SPI slave device).
Use unique fpga manager name for each registered manager. With
this change we have names with SPI slave device name encoded in
the manager name string, e.g. like "xlnx-slave-spi spi1.2".

Signed-off-by: Anatolij Gustschin <agust@denx.de>
---
 drivers/fpga/xilinx-spi.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/fpga/xilinx-spi.c b/drivers/fpga/xilinx-spi.c
index 469486be20c4..34b13d1c0f88 100644
--- a/drivers/fpga/xilinx-spi.c
+++ b/drivers/fpga/xilinx-spi.c
@@ -27,6 +27,7 @@ struct xilinx_spi_conf {
 	struct spi_device *spi;
 	struct gpio_desc *prog_b;
 	struct gpio_desc *done;
+	char mgr_name[64];
 };
 
 static enum fpga_mgr_states xilinx_spi_state(struct fpga_manager *mgr)
@@ -166,8 +167,11 @@ static int xilinx_spi_probe(struct spi_device *spi)
 		return PTR_ERR(conf->done);
 	}
 
-	mgr = devm_fpga_mgr_create(&spi->dev,
-				   "Xilinx Slave Serial FPGA Manager",
+	/* Register manager with unique name */
+	snprintf(conf->mgr_name, sizeof(conf->mgr_name), "%s %s",
+		 dev_driver_string(&spi->dev), dev_name(&spi->dev));
+
+	mgr = devm_fpga_mgr_create(&spi->dev, conf->mgr_name,
 				   &xilinx_spi_ops, conf);
 	if (!mgr)
 		return -ENOMEM;
-- 
2.17.1

             reply	other threads:[~2018-10-29 23:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-29 14:42 Anatolij Gustschin [this message]
2018-10-29 16:48 ` [PATCH] fpga: xilinx-spi: Use unique FPGA manager names Moritz Fischer
2018-10-30 11:19   ` Anatolij Gustschin
2018-11-01 18:21     ` Alan Tull
2018-11-01 18:33       ` Anatolij Gustschin
2018-11-01 18:46         ` Alan Tull
2018-11-01 19:23           ` Anatolij Gustschin
2018-11-01 19:44             ` Moritz Fischer

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=20181029144222.26927-1-agust@denx.de \
    --to=agust@denx.de \
    --cc=atull@kernel.org \
    --cc=linux-fpga@vger.kernel.org \
    --cc=mdf@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;
as well as URLs for NNTP newsgroup(s).