Commit c78439f8 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Merge tag 'fpga-fixes-for-5.3' of...

Merge tag 'fpga-fixes-for-5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/mdf/linux-fpga into char-misc-linus

Moritz writes:

FPGA Manager fixes for 5.3

A single fix for the altera-ps-spi driver that fixes the behavior when
the driver receives -EPROBE_DEFER when trying to obtain a GPIO desc.
Signed-off-by: default avatarMoritz Fischer <mdf@kernel.org>

* tag 'fpga-fixes-for-5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/mdf/linux-fpga:
  fpga: altera-ps-spi: Fix getting of optional confd gpio
parents a642a0b3 dec43da4
...@@ -210,7 +210,7 @@ static int altera_ps_write_complete(struct fpga_manager *mgr, ...@@ -210,7 +210,7 @@ static int altera_ps_write_complete(struct fpga_manager *mgr,
return -EIO; return -EIO;
} }
if (!IS_ERR(conf->confd)) { if (conf->confd) {
if (!gpiod_get_raw_value_cansleep(conf->confd)) { if (!gpiod_get_raw_value_cansleep(conf->confd)) {
dev_err(&mgr->dev, "CONF_DONE is inactive!\n"); dev_err(&mgr->dev, "CONF_DONE is inactive!\n");
return -EIO; return -EIO;
...@@ -289,10 +289,13 @@ static int altera_ps_probe(struct spi_device *spi) ...@@ -289,10 +289,13 @@ static int altera_ps_probe(struct spi_device *spi)
return PTR_ERR(conf->status); return PTR_ERR(conf->status);
} }
conf->confd = devm_gpiod_get(&spi->dev, "confd", GPIOD_IN); conf->confd = devm_gpiod_get_optional(&spi->dev, "confd", GPIOD_IN);
if (IS_ERR(conf->confd)) { if (IS_ERR(conf->confd)) {
dev_warn(&spi->dev, "Not using confd gpio: %ld\n", dev_err(&spi->dev, "Failed to get confd gpio: %ld\n",
PTR_ERR(conf->confd)); PTR_ERR(conf->confd));
return PTR_ERR(conf->confd);
} else if (!conf->confd) {
dev_warn(&spi->dev, "Not using confd gpio");
} }
/* Register manager with unique name */ /* Register manager with unique name */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment