]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
of: property: fw_devlink: do not link ".*,nr-gpios"
authorIlya Lipnitskiy <ilya.lipnitskiy@gmail.com>
Mon, 5 Apr 2021 22:25:40 +0000 (15:25 -0700)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 7 May 2021 07:53:21 +0000 (09:53 +0200)
commit9f1c9488d853babe13b3b2c50b2c5494850d606f
tree17210e604b9a982680999c28bac7c2a9df0d73d3
parentd5e9f2c29ea639001493af8c32a386fa1e082a43
of: property: fw_devlink: do not link ".*,nr-gpios"

BugLink: https://bugs.launchpad.net/bugs/1926368
commit d473d32c2fbac2d1d7082c61899cfebd34eb267a upstream.

[<vendor>,]nr-gpios property is used by some GPIO drivers[0] to indicate
the number of GPIOs present on a system, not define a GPIO. nr-gpios is
not configured by #gpio-cells and can't be parsed along with other
"*-gpios" properties.

nr-gpios without the "<vendor>," prefix is not allowed by the DT
spec[1], so only add exception for the ",nr-gpios" suffix and let the
error message continue being printed for non-compliant implementations.

[0] nr-gpios is referenced in Documentation/devicetree/bindings/gpio:
 - gpio-adnp.txt
 - gpio-xgene-sb.txt
 - gpio-xlp.txt
 - snps,dw-apb-gpio.yaml

Link: https://github.com/devicetree-org/dt-schema/blob/cb53a16a1eb3e2169ce170c071e47940845ec26e/schemas/gpio/gpio-consumer.yaml#L20
Fixes errors such as:
  OF: /palmbus@300000/gpio@600: could not find phandle

Fixes: 7f00be96f125 ("of: property: Add device link support for interrupt-parent, dmas and -gpio(s)")
Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
Cc: Saravana Kannan <saravanak@google.com>
Cc: stable@vger.kernel.org # v5.5+
Link: https://lore.kernel.org/r/20210405222540.18145-1-ilya.lipnitskiy@gmail.com
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/of/property.c