Commit 2dd9072e authored by Pali Rohár's avatar Pali Rohár Committed by Lorenzo Pieralisi

PCI: of: Zero max-link-speed value is invalid

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.orgTested-by: default avatarTomasz Maciej Nowak <tmn505@gmail.com>
Signed-off-by: default avatarPali Rohár <pali@kernel.org>
Signed-off-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Acked-by: default avatarRob Herring <robh@kernel.org>
Acked-by: default avatarThomas Petazzoni <thomas.petazzoni@bootlin.com>
parent 90c6cb4a
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment