spi: Pick spi bus number from Linux idr or spi alias
authorSuniel Mahesh <sunil.m@techveda.org>
Thu, 3 Aug 2017 04:35:57 +0000 (10:05 +0530)
committerMark Brown <broonie@kernel.org>
Wed, 16 Aug 2017 15:38:03 +0000 (16:38 +0100)
commit9b61e302210eba55768962f2f11e96bb508c2408
tree486c4f171124859962b13ae4c90475de0af6530c
parente0bcb680b152c96ee4b561abbeb18743cdcc5ae3
spi: Pick spi bus number from Linux idr or spi alias

Modify existing code, for automatically picking the spi bus number based
on Linux idr scheme as mentioned in FIXME.
This patch does the following:
(a) Remove the now unnecessary code which was allocating bus numbers using
    ATOMIC_INIT and atomic_dec_return macros.
(b) If we have an alias, pick the bus number from alias ID
(c) Convert to linux idr interface

Signed-off-by: Suniel Mahesh <sunil.m@techveda.org>
Signed-off-by: Karthik Tummala <karthik@techveda.org>
Tested-by: Karthik Tummala <karthik@techveda.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi.c