gpio: 74x164: Make use of device properties
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 25 Mar 2019 13:47:46 +0000 (15:47 +0200)
committerBartosz Golaszewski <bgolaszewski@baylibre.com>
Tue, 26 Mar 2019 17:37:18 +0000 (18:37 +0100)
ACPI-enabled platforms can use this device via unified device
properties API. Convert driver to support this.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
drivers/gpio/gpio-74x164.c

index fb7b620..5f91d76 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/spi/spi.h>
 #include <linux/gpio/driver.h>
 #include <linux/gpio/consumer.h>
+#include <linux/property.h>
 #include <linux/slab.h>
 #include <linux/module.h>
 
@@ -116,10 +117,9 @@ static int gen_74x164_probe(struct spi_device *spi)
        if (ret < 0)
                return ret;
 
-       if (of_property_read_u32(spi->dev.of_node, "registers-number",
-                                &nregs)) {
-               dev_err(&spi->dev,
-                       "Missing registers-number property in the DT.\n");
+       ret = device_property_read_u32(&spi->dev, "registers-number", &nregs);
+       if (ret) {
+               dev_err(&spi->dev, "Missing 'registers-number' property.\n");
                return -EINVAL;
        }