summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2016-10-10 08:31:07 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2016-10-10 08:31:07 +0200
commitbfdb14c7dacf3e50a27b749259f6660ab9e930d5 (patch)
treefe81dec7194671caee4e94ac7fb68fe6e519e6df /drivers
parentdf75f19871d764c421cbce19f502ea863e5affd4 (diff)
parente4a45c096136deaf56a200054c46f474250cc89c (diff)
downloadbarebox-bfdb14c7dacf3e50a27b749259f6660ab9e930d5.tar.gz
barebox-bfdb14c7dacf3e50a27b749259f6660ab9e930d5.tar.xz
Merge branch 'for-next/misc'
Diffstat (limited to 'drivers')
-rw-r--r--drivers/firmware/altera_serial.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/drivers/firmware/altera_serial.c b/drivers/firmware/altera_serial.c
index 4527d27c5c..b119778d72 100644
--- a/drivers/firmware/altera_serial.c
+++ b/drivers/firmware/altera_serial.c
@@ -35,9 +35,9 @@
*
* fpga@0 {
* compatible = "altr,fpga-passive-serial";
- * nstat-gpio = <&gpio4 18 0>;
- * confd-gpio = <&gpio4 19 0>;
- * nconfig-gpio = <&gpio4 20 0>;
+ * nstat-gpios = <&gpio4 18 0>;
+ * confd-gpios = <&gpio4 19 0>;
+ * nconfig-gpios = <&gpio4 20 0>;
* spi-max-frequency = <10000000>;
* reg = <0>;
* };
@@ -220,26 +220,24 @@ static int altera_spi_of(struct device_d *dev, struct fpga_spi *this)
const char *name;
int ret;
- name = "nstat-gpio";
- if (!of_get_property(n, name, NULL)) {
+ name = "nstat-gpios";
+ 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-gpio";
+ name = "confd-gpios";
this->confd_gpio = of_get_named_gpio(n, name, 0);
if (this->confd_gpio < 0) {
ret = this->confd_gpio;
goto out;
}
- name = "nconfig-gpio";
+ name = "nconfig-gpios";
this->nconfig_gpio = of_get_named_gpio(n, name, 0);
if (this->nconfig_gpio < 0) {
ret = this->nconfig_gpio;
@@ -330,7 +328,7 @@ out:
static struct of_device_id altera_spi_id_table[] = {
{
- .compatible = "altr,passive-serial",
+ .compatible = "altr,fpga-passive-serial",
},
};