]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
gpio: max7301: fix driver for use with CONFIG_VMAP_STACK
authorChristophe Leroy <christophe.leroy@c-s.fr>
Fri, 7 Dec 2018 13:07:55 +0000 (13:07 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 29 Dec 2018 12:39:09 +0000 (13:39 +0100)
commit07cfa7ac9e52d3250061e3cb91acfecb905afefb
treed4f08a5baaa4a7559fd34f5cbf8fa6e2d59fe2d1
parent4d7a081d0a35a2cd1908451edf66755914cc6ef1
gpio: max7301: fix driver for use with CONFIG_VMAP_STACK

commit abf221d2f51b8ce7b9959a8953f880a8b0a1400d upstream.

spi_read() and spi_write() require DMA-safe memory. When
CONFIG_VMAP_STACK is selected, those functions cannot be used
with buffers on stack.

This patch replaces calls to spi_read() and spi_write() by
spi_write_then_read() which doesn't require DMA-safe buffers.

Fixes: 0c36ec314735 ("gpio: gpio driver for max7301 SPI GPIO expander")
Cc: <stable@vger.kernel.org>
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpio/gpio-max7301.c