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

Subsystems: spi subsystem, the rest

STALE2975d

3 messages, 3 authors, 2018-06-20 · open the first message on its own page

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

From: Joakim Tjernlund <hidden>
Date: 2018-06-19 16:30:41

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 <redacted>
---
 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",
+					  &cell_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

From: York Sun <hidden>
Date: 2018-06-19 16:29:42

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

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

From: Mark Brown <broonie@kernel.org>
Date: 2018-06-20 10:36:46

On Tue, Jun 19, 2018 at 04:29:35PM +0000, 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:
quoted
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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help