Skip to content
Commit 1d434216 authored by Sifan Naeem's avatar Sifan Naeem Committed by Greg Kroah-Hartman
Browse files

spi: img-spfi: fix multiple calls to request gpio



commit b03ba9e3 upstream.

spfi_setup may be called many times by the spi framework, but
gpio_request_one can only be called once without freeing, repeatedly
calling gpio_request_one will cause an error to be thrown, which
causes the request to spi_setup to be marked as failed.

We can have a per-spi_device flag that indicates whether or not the
gpio has been requested. If the gpio has already been requested use
gpio_direction_output to set the direction of the gpio.

Fixes: 8c2c8c03 ("spi: img-spfi: Control CS lines with GPIO")
Signed-off-by: default avatarSifan Naeem <sifan.naeem@imgtec.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b82ed8c9
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment