Get the bus_num from devicetree if a "spi" alias exists. Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx> --- drivers/spi/spi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index f035cc2..b9397ad 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -225,6 +225,9 @@ int spi_register_master(struct spi_master *master) if (master->num_chipselect == 0) return -EINVAL; + if ((master->bus_num < 0) && master->dev->device_node) + master->bus_num = of_alias_get_id(master->dev->device_node, "spi"); + /* convention: dynamically assigned bus IDs count down from the max */ if (master->bus_num < 0) master->bus_num = dyn_bus_id--; -- 1.8.4.rc3 _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox