diff mbox series

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

Message ID 20180619162304.20125-1-joakim.tjernlund@infinera.com (mailing list archive)
State Not Applicable
Headers show
Series spi/fsl-espi: Add missing cell-index OF property | expand

Commit Message

Joakim Tjernlund June 19, 2018, 4:23 p.m. UTC
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 <joakim.tjernlund@infinera.com>
---
 drivers/spi/spi-fsl-espi.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Mark Brown June 20, 2018, 10:36 a.m. UTC | #1
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:
> > 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.
diff mbox series

Patch

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;