diff options
author | Pali Rohár <pali@kernel.org> | 2020-04-30 10:06:16 +0200 |
---|---|---|
committer | Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> | 2020-05-18 14:40:38 +0100 |
commit | 2dd9072e8fb0af4af47c912244f6c16fc57d4fbc (patch) | |
tree | 790dbd9ea93c7598d233101c4fb3a9c315d6cea4 /drivers/pci | |
parent | 90c6cb4a355e7befcb557d217d1d8b8bd5875a05 (diff) |
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.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>
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/of.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pci/of.c b/drivers/pci/of.c index 81ceeaa6f1d5..27839cd2459f 100644 --- a/drivers/pci/of.c +++ b/drivers/pci/of.c @@ -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; |