OSDN Git Service

fpga: mgr: altera-ps-spi: enable usage on non-dt platforms
authorAnatolij Gustschin <agust@denx.de>
Mon, 26 Nov 2018 17:35:28 +0000 (11:35 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 26 Nov 2018 19:12:05 +0000 (20:12 +0100)
commit1a195d87d2c58aa9524af9531539ccfa203cd52c
tree21cae2d4de4ac35614ff93c4003bde1be0e1922b
parent30522a951f9d02f261d0697c35cb42205b1fae17
fpga: mgr: altera-ps-spi: enable usage on non-dt platforms

Driver probing fails on non-dt platforms since of_match_device()
always returns NULL here. Add spi ids with device names and
matching driver data as an index of a map array with data for
supported devices. Add this map array and a function for mapping
spi ids to driver data. This allows driver binding to dynamically
added PS-SPI devices (e.g. when added via spi_new_device() after
hot-plugging).

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Acked-by: Alan Tull <atull@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/fpga/altera-ps-spi.c