]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
PCI: cadence: Fix to read 32-bit Vendor ID/Device ID property from DT
authorKishon Vijay Abraham I <kishon@ti.com>
Fri, 8 May 2020 13:06:45 +0000 (18:36 +0530)
committerLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Mon, 18 May 2020 14:52:34 +0000 (15:52 +0100)
The PCI Bus Binding specification (IEEE Std 1275-1994 Revision 2.1 [1])
defines both Vendor ID and Device ID to be 32-bits. Fix
pcie-cadence-host.c driver to read 32-bit Vendor ID and Device ID
properties from device tree.

[1] -> https://www.devicetree.org/open-firmware/bindings/pci/pci2_1.pdf

Link: https://lore.kernel.org/r/20200508130646.23939-4-kishon@ti.com
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Acked-by: Rob Herring <robh@kernel.org>
Acked-by: Tom Joseph <tjoseph@cadence.com>
drivers/pci/controller/cadence/pcie-cadence-host.c
drivers/pci/controller/cadence/pcie-cadence.h

index e5e9a3293579e1ef6c6286db66bfde3d0e5d308c..8c2543f28ba057f1150e5572f86ed86c773fe074 100644 (file)
@@ -220,10 +220,10 @@ int cdns_pcie_host_setup(struct cdns_pcie_rc *rc)
        of_property_read_u32(np, "cdns,no-bar-match-nbits", &rc->no_bar_nbits);
 
        rc->vendor_id = 0xffff;
-       of_property_read_u16(np, "vendor-id", &rc->vendor_id);
+       of_property_read_u32(np, "vendor-id", &rc->vendor_id);
 
        rc->device_id = 0xffff;
-       of_property_read_u16(np, "device-id", &rc->device_id);
+       of_property_read_u32(np, "device-id", &rc->device_id);
 
        res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "reg");
        pcie->reg_base = devm_ioremap_resource(dev, res);
index 6bd89a21bb1cbbaa7e388bac2bd5e3e8fbca1d54..df14ad002fe924470f01eb2b6393392a06fccc73 100644 (file)
@@ -262,8 +262,8 @@ struct cdns_pcie_rc {
        struct resource         *bus_range;
        void __iomem            *cfg_base;
        u32                     no_bar_nbits;
-       u16                     vendor_id;
-       u16                     device_id;
+       u32                     vendor_id;
+       u32                     device_id;
 };
 
 /**