summaryrefslogtreecommitdiffstats
path: root/drivers/firmware
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2016-09-26 11:11:37 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2016-09-27 08:10:10 +0200
commita1e19c94d13d1b1eb4c8bc4f4dfce0dd3500bdfa (patch)
tree66bc8d5542dfee763bcd95fb56f1aa2fbb95b671 /drivers/firmware
parenteb2b96d68a3b216b3f935383979a8c67a257bebc (diff)
downloadbarebox-a1e19c94d13d1b1eb4c8bc4f4dfce0dd3500bdfa.tar.gz
barebox-a1e19c94d13d1b1eb4c8bc4f4dfce0dd3500bdfa.tar.xz
firmware: altera-serial: simplify handling of optional gpio
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/firmware')
-rw-r--r--drivers/firmware/altera_serial.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/firmware/altera_serial.c b/drivers/firmware/altera_serial.c
index 382e845001..b119778d72 100644
--- a/drivers/firmware/altera_serial.c
+++ b/drivers/firmware/altera_serial.c
@@ -221,15 +221,13 @@ static int altera_spi_of(struct device_d *dev, struct fpga_spi *this)
int ret;
name = "nstat-gpios";
- if (!of_get_property(n, name, NULL)) {
+ this->nstat_gpio = of_get_named_gpio(n, name, 0);
+ if (this->nstat_gpio == -ENOENT) {
dev_info(dev, "nstat-gpio is not specified, assuming it is not connected\n");
this->nstat_gpio = -1;
- } else {
- this->nstat_gpio = of_get_named_gpio(n, name, 0);
- if (this->nstat_gpio < 0) {
- ret = this->nstat_gpio;
- goto out;
- }
+ } else if (this->nstat_gpio < 0) {
+ ret = this->nstat_gpio;
+ goto out;
}
name = "confd-gpios";