Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1656120

Re: [PATCH v5 10/11] gpio-exar/8250-exar: Make set of exported GPIOs configurable

From Andy Shevchenko <andy.shevchenko@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH v5 10/11] gpio-exar/8250-exar: Make set of exported GPIOs configurable
Date 2017-06-02 12:40 +0200
Message-ID <tNS9P-8iV-1@gated-at.bofh.it> (permalink)
References <tNPbZ-6hW-27@gated-at.bofh.it> <tNPlE-6o8-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, Jun 2, 2017 at 10:28 AM, Jan Kiszka <jan.kiszka@siemens.com> wrote:
> On the SIMATIC, IOT2040 only a single pin is exportable as GPIO, the
> rest is required to operate the UART. To allow modeling this case,
> expand the platform device data structure to specify a (consecutive) pin
> subset for exporting by the gpio-exar driver.

> +       if (device_property_read_u32(&pdev->dev, "gpio-exar,first-pin",
> +                                    &first_pin) < 0 ||
> +           device_property_read_u32(&pdev->dev, "ngpios", &ngpios) < 0)
> +               return -EINVAL;

You shadow an error.

Please use
ret = device_property_...;
if (ret)
 return ret;

ret = ...
...

Moreover, I missed how you named first property, I would go rather
with "linux," prefix to show that is _internal_ / Linux only property.

Perhaps something like "linux,first-pin" ?

-- 
With Best Regards,
Andy Shevchenko

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v5 00/11] serial/gpio: exar: Fixes and support for IOT2000 Jan Kiszka <jan.kiszka@siemens.com> - 2017-06-02 09:30 +0200
  [PATCH v5 01/11] serial: exar: Leave MPIOs as output for Commtech adapters Jan Kiszka <jan.kiszka@siemens.com> - 2017-06-02 09:30 +0200
  [PATCH v5 04/11] gpio: exar: Allocate resources on behalf of the platform device Jan Kiszka <jan.kiszka@siemens.com> - 2017-06-02 09:30 +0200
  [PATCH v5 11/11] serial: exar: Add support for IOT2040 device Jan Kiszka <jan.kiszka@siemens.com> - 2017-06-02 09:40 +0200
  [PATCH v5 05/11] gpio: exar: Fix iomap request Jan Kiszka <jan.kiszka@siemens.com> - 2017-06-02 09:40 +0200
  [PATCH v5 02/11] gpio-exar/8250-exar: Do not even instantiate a GPIO device for Commtech cards Jan Kiszka <jan.kiszka@siemens.com> - 2017-06-02 09:40 +0200
  [PATCH v5 08/11] serial: exar: Factor out platform hooks Jan Kiszka <jan.kiszka@siemens.com> - 2017-06-02 09:40 +0200
  [PATCH v5 07/11] gpio-exar/8250-exar: Rearrange gpiochip parenthood Jan Kiszka <jan.kiszka@siemens.com> - 2017-06-02 09:40 +0200
  [PATCH v5 10/11] gpio-exar/8250-exar: Make set of exported GPIOs configurable Jan Kiszka <jan.kiszka@siemens.com> - 2017-06-02 09:40 +0200
    Re: [PATCH v5 10/11] gpio-exar/8250-exar: Make set of exported GPIOs configurable Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-06-02 12:40 +0200
  [PATCH v5 03/11] gpio-exar/8250-exar: Fix passing in of parent PCI device Jan Kiszka <jan.kiszka@siemens.com> - 2017-06-02 09:40 +0200
  [PATCH v5 06/11] gpio: exar: Fix reading of directions and values Jan Kiszka <jan.kiszka@siemens.com> - 2017-06-02 09:40 +0200
  [PATCH v5 09/11] platform: Accept const properties Jan Kiszka <jan.kiszka@siemens.com> - 2017-06-02 09:40 +0200

csiph-web