Skip to content

Commit 2dd9072

Browse files
paliLorenzo Pieralisi
authored andcommitted
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/[email protected] Tested-by: Tomasz Maciej Nowak <[email protected]> Signed-off-by: Pali Rohár <[email protected]> Signed-off-by: Lorenzo Pieralisi <[email protected]> Acked-by: Rob Herring <[email protected]> Acked-by: Thomas Petazzoni <[email protected]>
1 parent 90c6cb4 commit 2dd9072

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/pci/of.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ int of_pci_get_max_link_speed(struct device_node *node)
592592
u32 max_link_speed;
593593

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

598598
return max_link_speed;

0 commit comments

Comments
 (0)