]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.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)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commit7cb94a19837ac45e402f2d09de1f3e72ffb92d23
treed7743ddb73b60b07e5a70fbbe2f9d6511b4e0321
parentc0a35b8fbdd1d7efbe2ac4da537b809a191f2f6e
gpio: max7301: fix driver for use with CONFIG_VMAP_STACK

BugLink: https://bugs.launchpad.net/bugs/1837257
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>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/gpio/gpio-max7301.c