spi: atmel: use managed resource for gpio chip select
authorNicolas Ferre <nicolas.ferre@atmel.com>
Tue, 8 Nov 2016 17:48:52 +0000 (18:48 +0100)
committerMark Brown <broonie@kernel.org>
Wed, 9 Nov 2016 13:04:17 +0000 (13:04 +0000)
commit9610620078a3900e7fad82de620ce809fd29ba60
tree2b1a6a4eab45a3e472eff39a7e23ff5211b2bc37
parent1001354ca34179f3db924eb66672442a173147dc
spi: atmel: use managed resource for gpio chip select

Use the managed gpio CS pin request so that we avoid having trouble
in the cleanup code.
In fact, if module was configured with DT, cleanup code released
invalid pin.  Since resource wasn't freed, module cannot be reinserted.

This require to extract the gpio request call from the "setup" function
and call it in the appropriate probe function.

Reported-by: Alexander Morozov <linux@meltdown.ru>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-atmel.c