Skip to content

Commit d473d32

Browse files
lipnitskrobherring
authored andcommitted
of: property: fw_devlink: do not link ".*,nr-gpios"
[<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 [1] 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: 7f00be9 ("of: property: Add device link support for interrupt-parent, dmas and -gpio(s)") Signed-off-by: Ilya Lipnitskiy <[email protected]> Cc: Saravana Kannan <[email protected]> Cc: [email protected] # v5.5+ Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Rob Herring <[email protected]>
1 parent 21d6ff3 commit d473d32

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

drivers/of/property.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1260,7 +1260,16 @@ DEFINE_SIMPLE_PROP(pinctrl7, "pinctrl-7", NULL)
12601260
DEFINE_SIMPLE_PROP(pinctrl8, "pinctrl-8", NULL)
12611261
DEFINE_SUFFIX_PROP(regulators, "-supply", NULL)
12621262
DEFINE_SUFFIX_PROP(gpio, "-gpio", "#gpio-cells")
1263-
DEFINE_SUFFIX_PROP(gpios, "-gpios", "#gpio-cells")
1263+
1264+
static struct device_node *parse_gpios(struct device_node *np,
1265+
const char *prop_name, int index)
1266+
{
1267+
if (!strcmp_suffix(prop_name, ",nr-gpios"))
1268+
return NULL;
1269+
1270+
return parse_suffix_prop_cells(np, prop_name, index, "-gpios",
1271+
"#gpio-cells");
1272+
}
12641273

12651274
static struct device_node *parse_iommu_maps(struct device_node *np,
12661275
const char *prop_name, int index)

0 commit comments

Comments
 (0)