mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] spi: dln2: Pass of_node to spi master
@ 2016-04-15 12:10 Crestez Dan Leonard
  2016-04-15 12:19 ` Laurentiu Palcu
  2016-04-18 13:11 ` Applied "spi: dln2: Pass of_node to spi master" to the spi tree Mark Brown
  0 siblings, 2 replies; 4+ messages in thread
From: Crestez Dan Leonard @ 2016-04-15 12:10 UTC (permalink / raw)
  To: Mark Brown, linux-spi
  Cc: linux-kernel, Octavian Purdila, Laurentiu Palcu, Daniel Baluta,
	Tiberiu Breana, Crestez Dan Leonard

This allows defining SPI devices connected to a DLN2 using devicetree.

This already works for i2c because of a similar patch:
3b10db23: i2c: dln2: set the device tree node of the adapter

Signed-off-by: Crestez Dan Leonard <leonard.crestez@intel.com>
---
 drivers/spi/spi-dln2.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/spi/spi-dln2.c b/drivers/spi/spi-dln2.c
index 3b7d91d..4e8a862 100644
--- a/drivers/spi/spi-dln2.c
+++ b/drivers/spi/spi-dln2.c
@@ -683,6 +683,7 @@ static int dln2_spi_probe(struct platform_device *pdev)
 	struct spi_master *master;
 	struct dln2_spi *dln2;
 	struct dln2_platform_data *pdata = dev_get_platdata(&pdev->dev);
+	struct device *dev = &pdev->dev;
 	int ret;
 
 	master = spi_alloc_master(&pdev->dev, sizeof(*dln2));
@@ -700,6 +701,8 @@ static int dln2_spi_probe(struct platform_device *pdev)
 	}
 
 	dln2->master = master;
+	dln2->master->dev.parent = dev;
+	dln2->master->dev.of_node = dev->of_node;
 	dln2->pdev = pdev;
 	dln2->port = pdata->port;
 	/* cs/mode can never be 0xff, so the first transfer will set them */
-- 
2.5.5

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

end of thread, other threads:[~2016-04-18 13:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-15 12:10 [PATCH] spi: dln2: Pass of_node to spi master Crestez Dan Leonard
2016-04-15 12:19 ` Laurentiu Palcu
2016-04-15 17:02   ` Mark Brown
2016-04-18 13:11 ` Applied "spi: dln2: Pass of_node to spi master" to the spi tree Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®