]> rtime.felk.cvut.cz Git - hercules2020/nv-tegra/linux-4.4.git/commit
spi: Map SPI OF client IRQ at probe time
authorJon Hunter <jonathanh@nvidia.com>
Fri, 9 Oct 2015 14:45:55 +0000 (15:45 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 12 Oct 2015 16:34:05 +0000 (17:34 +0100)
commit44af7927316e83eb8865933f7c836dcc85f8eb74
treebecd407b8c6c2ffb7ee833373a67b08117e51aa6
parent6ff33f3902c3b1c5d0db6b1e2c70b6d76fba357f
spi: Map SPI OF client IRQ at probe time

Currently the IRQs for SPI client devices, registered via device-tree,
are mapped when the client devices are registered. If the corresponding
irq-chip has not been probed yet, then the probing of the client device
will fail and will not be retried. Resolve this by mapping the IRQ at
probe time and allow the probe to be deferred if the IRQ is not yet
available.

If of_irq_get() returns an error that is not -EPROBE_DEFER, then assume
that the SPI client does not have an IRQ and set the IRQ number to zero
(which is equivalent to irq_of_parse_and_map()).

This is based on some inputs from Thierry Reding <treding@nvidia.com>.

Cc: Thierry Reding <treding@nvidia.com>
Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi.c