Skip to content

Commit 1723c31

Browse files
linuswbroonie
authored andcommitted
spi: gpio: Fix copy-and-paste error
This fixes an embarrassing copy-and-paste error in the errorpath of spi_gpio_request(): we were checking the wrong struct member for error code right after retrieveing the sck GPIO. Fixes: 9b00bc7 ("spi: spi-gpio: Rewrite to use GPIO descriptors") Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 7001cab commit 1723c31

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/spi/spi-gpio.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,8 @@ static int spi_gpio_request(struct device *dev,
300300
*mflags |= SPI_MASTER_NO_RX;
301301

302302
spi_gpio->sck = devm_gpiod_get(dev, "sck", GPIOD_OUT_LOW);
303-
if (IS_ERR(spi_gpio->mosi))
304-
return PTR_ERR(spi_gpio->mosi);
303+
if (IS_ERR(spi_gpio->sck))
304+
return PTR_ERR(spi_gpio->sck);
305305

306306
for (i = 0; i < num_chipselects; i++) {
307307
spi_gpio->cs_gpios[i] = devm_gpiod_get_index(dev, "cs",

0 commit comments

Comments
 (0)