Message ID | 20190325134748.58730-1-andriy.shevchenko@linux.intel.com |
---|---|
State | New |
Headers | show |
Series | [v2,1/3] gpio: 74x164: Make use of device properties | expand |
pon., 25 mar 2019 o 14:47 Andy Shevchenko <andriy.shevchenko@linux.intel.com> napisał(a): > > 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> > --- > drivers/gpio/gpio-74x164.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpio/gpio-74x164.c b/drivers/gpio/gpio-74x164.c > index fb7b620763a2..5f91d7618909 100644 > --- a/drivers/gpio/gpio-74x164.c > +++ b/drivers/gpio/gpio-74x164.c > @@ -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; > } > > -- > 2.20.1 > Applied all three patches. For patch 1/3 I fixed the line length in the commit message. Bart
On Tue, Mar 26, 2019 at 06:39:38PM +0100, Bartosz Golaszewski wrote: > pon., 25 mar 2019 o 14:47 Andy Shevchenko > <andriy.shevchenko@linux.intel.com> napisał(a): > Applied all three patches. For patch 1/3 I fixed the line length in > the commit message. Thank you!
diff --git a/drivers/gpio/gpio-74x164.c b/drivers/gpio/gpio-74x164.c index fb7b620763a2..5f91d7618909 100644 --- a/drivers/gpio/gpio-74x164.c +++ b/drivers/gpio/gpio-74x164.c @@ -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; }
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> --- drivers/gpio/gpio-74x164.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)