提交 2dd9072e 编写于 作者: P Pali Rohár 提交者: 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: NTomasz Maciej Nowak <tmn505@gmail.com>
Signed-off-by: NPali Rohár <pali@kernel.org>
Signed-off-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Acked-by: NRob Herring <robh@kernel.org>
Acked-by: NThomas Petazzoni <thomas.petazzoni@bootlin.com>
上级 90c6cb4a
...@@ -592,7 +592,7 @@ int of_pci_get_max_link_speed(struct device_node *node) ...@@ -592,7 +592,7 @@ int of_pci_get_max_link_speed(struct device_node *node)
u32 max_link_speed; u32 max_link_speed;
if (of_property_read_u32(node, "max-link-speed", &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 -EINVAL;
return max_link_speed; return max_link_speed;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册