staging: mt7621-pci: remove 'offset' with mem and io resource sizes
authorSergio Paracuellos <sergio.paracuellos@gmail.com>
Mon, 23 Nov 2020 09:36:32 +0000 (10:36 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 26 Nov 2020 08:12:18 +0000 (09:12 +0100)
Offset contains resources size for both io and memory resources.
Those fields are directly initialized to zero and set up using
'pci_add_resource_offset' function. Instead of doing that remove
them and use directly function 'pci_add_resource' where zero is
passed directly to its internal call to 'pci_add_resource_offset'.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Link: https://lore.kernel.org/r/20201123093637.8300-3-sergio.paracuellos@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/mt7621-pci/pci-mt7621.c

index 3e8dddf..219b359 100644 (file)
@@ -117,7 +117,6 @@ struct mt7621_pcie_port {
  * @base: IO Mapped Register Base
  * @io: IO resource
  * @mem: non-prefetchable memory resource
- * @offset: IO / Memory offset
  * @dev: Pointer to PCIe device
  * @io_map_base: virtual memory base address for io
  * @ports: pointer to PCIe port information
@@ -130,10 +129,6 @@ struct mt7621_pcie {
        struct device *dev;
        struct resource io;
        struct resource mem;
-       struct {
-               resource_size_t mem;
-               resource_size_t io;
-       } offset;
        unsigned long io_map_base;
        struct list_head ports;
        int irq_map[PCIE_P2P_CNT];
@@ -312,11 +307,9 @@ static int mt7621_pci_parse_request_of_pci_ranges(struct mt7621_pcie *pcie)
                        of_pci_range_to_resource(&range, node, &pcie->io);
                        pcie->io.start = range.cpu_addr;
                        pcie->io.end = range.cpu_addr + range.size - 1;
-                       pcie->offset.io = 0x00000000UL;
                        break;
                case IORESOURCE_MEM:
                        of_pci_range_to_resource(&range, node, &pcie->mem);
-                       pcie->offset.mem = 0x00000000UL;
                        break;
                }
        }
@@ -644,8 +637,8 @@ static int mt7621_pcie_init_virtual_bridges(struct mt7621_pcie *pcie)
 static void mt7621_pcie_add_resources(struct mt7621_pcie *pcie,
                                      struct list_head *res)
 {
-       pci_add_resource_offset(res, &pcie->io, pcie->offset.io);
-       pci_add_resource_offset(res, &pcie->mem, pcie->offset.mem);
+       pci_add_resource(res, &pcie->io);
+       pci_add_resource(res, &pcie->mem);
 }
 
 static int mt7621_pcie_register_host(struct pci_host_bridge *host,