]> git.baikalelectronics.ru Git - kernel.git/commit
spi: Fix double IDR allocation with DT aliases
authorGeert Uytterhoeven <geert+renesas@glider.be>
Tue, 21 Aug 2018 09:53:03 +0000 (11:53 +0200)
committerMark Brown <broonie@kernel.org>
Tue, 28 Aug 2018 19:46:27 +0000 (20:46 +0100)
commit2c8a399dcca7e55df3670e0feaab4e740b3d446b
treed9fd964eeaa90b0884756a566039284158c683a7
parent3fe3e812eeac22d493f75707d77dcd1830672839
spi: Fix double IDR allocation with DT aliases

If the SPI bus number is provided by a DT alias, idr_alloc() is called
twice, leading to:

    WARNING: CPU: 1 PID: 1 at drivers/spi/spi.c:2179 spi_register_controller+0x11c/0x5d8
    couldn't get idr

Fix this by moving the handling of fixed SPI bus numbers up, before the
DT handling code fills in ctlr->bus_num.

Fixes: 3fe3e812eeac22d4 ("spi: fix IDR collision on systems with both fixed and dynamic SPI bus numbers")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi.c