Skip to content

Commit

Permalink
PCI: of: Zero max-link-speed value is invalid
Browse files Browse the repository at this point in the history
Interpret zero value of max-link-speed property as invalid,
as the device tree bindings documentation specifies.

Link: https://lore.kernel.org/r/20200430080625.26070-4-pali@kernel.org
Tested-by: Tomasz Maciej Nowak <tmn505@gmail.com>
Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Acked-by: Rob Herring <robh@kernel.org>
Acked-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
  • Loading branch information
Pali Rohár authored and Lorenzo Pieralisi committed May 18, 2020
1 parent 90c6cb4 commit 2dd9072
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/pci/of.c
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ int of_pci_get_max_link_speed(struct device_node *node)
u32 max_link_speed;

if (of_property_read_u32(node, "max-link-speed", &max_link_speed) ||
max_link_speed > 4)
max_link_speed == 0 || max_link_speed > 4)
return -EINVAL;

return max_link_speed;
Expand Down

0 comments on commit 2dd9072

Please sign in to comment.