8devices / carambola2

Carambola 2 - an AR9331/SoC based PCB
GNU General Public License v2.0
56 stars 43 forks source link

ath79-spi unregisters gpio #43

Open GiedriusM opened 10 years ago

GiedriusM commented 10 years ago

If there is an exported system GPIO_X (/sys/class/gpio/gpioX) and new SPI device is registered with chip select as GPIO_X then the registration fails, but the GPIO_X is unexported from system class. Trying to reregister SPI device for second time succeeds.

So far this seems to work: static void ath79_spi_cleanup(struct spi_device *spi) { if (spi->controller_state) ath79_spi_cleanup_cs(spi); spi_bitbang_cleanup(spi); }

TODO: test the fix and create a patch