Re: [PATCH] spi/fsl-espi: Add missing cell-index OF property

2018-06-20 Thread Mark Brown
On Tue, Jun 19, 2018 at 04:29:35PM +, York Sun wrote:
> Joakim,
> 
> I am not the maintainer for this driver. Adding Mark Brown.
> 
> York
> 
> On 06/19/2018 09:23 AM, Joakim Tjernlund wrote:
> > espi does not look for a OF cell-index property which
> > makes the bus numbering dynamic only. This add an

As documented in SubmittingPatches please send patches to the 
maintainers for the code you would like to change.  The normal kernel
workflow is that people apply patches from their inboxes, if they aren't
copied they are likely to not see the patch at all and it is much more
difficult to apply patches.


signature.asc
Description: PGP signature


[PATCH] spi/fsl-espi: Add missing cell-index OF property

2018-06-19 Thread Joakim Tjernlund
espi does not look for a OF cell-index property which
makes the bus numbering dynamic only. This add an
optional cell-index.

Signed-off-by: Joakim Tjernlund 
---
 drivers/spi/spi-fsl-espi.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/drivers/spi/spi-fsl-espi.c b/drivers/spi/spi-fsl-espi.c
index 1d332e23f6ed..56b71c5e2f10 100644
--- a/drivers/spi/spi-fsl-espi.c
+++ b/drivers/spi/spi-fsl-espi.c
@@ -672,6 +672,14 @@ static int fsl_espi_probe(struct device *dev, struct 
resource *mem,
 
dev_set_drvdata(dev, master);
 
+   if (dev->of_node) {
+   u32 cell_index;
+
+   if (!of_property_read_u32(dev->of_node, "cell-index",
+ _index))
+   master->bus_num = cell_index;
+   }
+
master->mode_bits = SPI_RX_DUAL | SPI_CPOL | SPI_CPHA | SPI_CS_HIGH |
SPI_LSB_FIRST | SPI_LOOP;
master->dev.of_node = dev->of_node;
-- 
2.13.6



Re: [PATCH] spi/fsl-espi: Add missing cell-index OF property

2018-06-19 Thread York Sun
Joakim,

I am not the maintainer for this driver. Adding Mark Brown.

York

On 06/19/2018 09:23 AM, Joakim Tjernlund wrote:
> espi does not look for a OF cell-index property which
> makes the bus numbering dynamic only. This add an
> optional cell-index.
> 
> Signed-off-by: Joakim Tjernlund 
> ---
>  drivers/spi/spi-fsl-espi.c | 8 
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/spi/spi-fsl-espi.c b/drivers/spi/spi-fsl-espi.c
> index 1d332e23f6ed..56b71c5e2f10 100644
> --- a/drivers/spi/spi-fsl-espi.c
> +++ b/drivers/spi/spi-fsl-espi.c
> @@ -672,6 +672,14 @@ static int fsl_espi_probe(struct device *dev, struct 
> resource *mem,
>  
>   dev_set_drvdata(dev, master);
>  
> + if (dev->of_node) {
> + u32 cell_index;
> +
> + if (!of_property_read_u32(dev->of_node, "cell-index",
> +   _index))
> + master->bus_num = cell_index;
> + }
> +
>   master->mode_bits = SPI_RX_DUAL | SPI_CPOL | SPI_CPHA | SPI_CS_HIGH |
>   SPI_LSB_FIRST | SPI_LOOP;
>   master->dev.of_node = dev->of_node;
>