diff mbox

spi: dln2: Pass of_node to spi master

Message ID 692686e5329a437499fbfb2c235e049979b415a3.1460722225.git.leonard.crestez@intel.com (mailing list archive)
State Accepted
Commit 83835fb07836eac1b35e98b919bf757ff7f77aad
Headers show

Commit Message

Crestez Dan Leonard April 15, 2016, 12:10 p.m. UTC
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(+)

Comments

Laurentiu Palcu April 15, 2016, 12:19 p.m. UTC | #1
On Fri, Apr 15, 2016 at 03:10:52PM +0300, Crestez Dan Leonard wrote:
> 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>
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@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
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Mark Brown April 15, 2016, 5:02 p.m. UTC | #2
On Fri, Apr 15, 2016 at 03:19:35PM +0300, Laurentiu Palcu wrote:
> On Fri, Apr 15, 2016 at 03:10:52PM +0300, Crestez Dan Leonard wrote:

> > Signed-off-by: Crestez Dan Leonard <leonard.crestez@intel.com>
> Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>

Signed-off-by has a specific meaning regarding ownership of patches and
validity of contribution, see SubmittingPatches - I'll take this as an
Acked-by.
diff mbox

Patch

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 */