spi: dln2: Pass of_node to spi master
authorCrestez Dan Leonard <leonard.crestez@intel.com>
Fri, 15 Apr 2016 12:10:52 +0000 (15:10 +0300)
committerMark Brown <broonie@kernel.org>
Fri, 15 Apr 2016 17:02:58 +0000 (18:02 +0100)
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>
Acked-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-dln2.c

index 3b7d91d94feace23ea2b0c9070a5d22a77aa9685..4e8a8629d51414d72549fa9b7aa15f6c507541c2 100644 (file)
@@ -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 */