diff mbox

[RFC,1/4] spi: dw-mmio: allow multiple instances

Message ID 74a507ce4370729cbc31c7e8d182821287ffcca1.1390481413.git.baruch@tkos.co.il (mailing list archive)
State Accepted
Commit 2418991efb7b1f9fc574771450ac17689682b3f6
Headers show

Commit Message

Baruch Siach Jan. 23, 2014, 1:05 p.m. UTC
Use the platform_device id to uniquely identify each SPI master instance.

Cc: Jean-Hugues Deschenes <jean-hugues.deschenes@octasic.com>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
 drivers/spi/spi-dw-mmio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Mark Brown Jan. 23, 2014, 7:50 p.m. UTC | #1
On Thu, Jan 23, 2014 at 03:05:56PM +0200, Baruch Siach wrote:
> Use the platform_device id to uniquely identify each SPI master instance.

This is OK but it'll be annoying if anything is using it for a stable
dev_name() since it'll probably renumber.  Not sure there's much we can
do without platform data though.
diff mbox

Patch

diff --git a/drivers/spi/spi-dw-mmio.c b/drivers/spi/spi-dw-mmio.c
index 9af56cdf1540..1492f5ee9aaa 100644
--- a/drivers/spi/spi-dw-mmio.c
+++ b/drivers/spi/spi-dw-mmio.c
@@ -66,7 +66,7 @@  static int dw_spi_mmio_probe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
-	dws->bus_num = 0;
+	dws->bus_num = pdev->id;
 	dws->num_cs = 4;
 	dws->max_freq = clk_get_rate(dwsmmio->clk);