Skip to content

Commit c78439f

Browse files
committed
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: Moritz Fischer <[email protected]> * 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
2 parents a642a0b + dec43da commit c78439f

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

drivers/fpga/altera-ps-spi.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ static int altera_ps_write_complete(struct fpga_manager *mgr,
210210
return -EIO;
211211
}
212212

213-
if (!IS_ERR(conf->confd)) {
213+
if (conf->confd) {
214214
if (!gpiod_get_raw_value_cansleep(conf->confd)) {
215215
dev_err(&mgr->dev, "CONF_DONE is inactive!\n");
216216
return -EIO;
@@ -289,10 +289,13 @@ static int altera_ps_probe(struct spi_device *spi)
289289
return PTR_ERR(conf->status);
290290
}
291291

292-
conf->confd = devm_gpiod_get(&spi->dev, "confd", GPIOD_IN);
292+
conf->confd = devm_gpiod_get_optional(&spi->dev, "confd", GPIOD_IN);
293293
if (IS_ERR(conf->confd)) {
294-
dev_warn(&spi->dev, "Not using confd gpio: %ld\n",
295-
PTR_ERR(conf->confd));
294+
dev_err(&spi->dev, "Failed to get confd gpio: %ld\n",
295+
PTR_ERR(conf->confd));
296+
return PTR_ERR(conf->confd);
297+
} else if (!conf->confd) {
298+
dev_warn(&spi->dev, "Not using confd gpio");
296299
}
297300

298301
/* Register manager with unique name */

0 commit comments

Comments
 (0)