All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fpga: xilinx-spi: Use unique FPGA manager names
@ 2018-10-29 14:42 Anatolij Gustschin
  2018-10-29 16:48 ` Moritz Fischer
  0 siblings, 1 reply; 8+ messages in thread
From: Anatolij Gustschin @ 2018-10-29 14:42 UTC (permalink / raw)
  To: linux-fpga; +Cc: atull, mdf

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

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-11-02  4:48 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-29 14:42 [PATCH] fpga: xilinx-spi: Use unique FPGA manager names Anatolij Gustschin
2018-10-29 16:48 ` 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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.