diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2020-06-04 12:59:16 -0500 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2020-06-04 12:59:16 -0500 |
commit | d388e541e2e3e26adfd9b1c99144176a73e19f95 (patch) | |
tree | 05b6e3b71ec742b52896c3ce6d87469b8aad7a15 /drivers/pci/controller/pci-host-generic.c | |
parent | d611b2b85331f3c69863d78835e95d1a5d01f2ef (diff) | |
parent | b2f75a41eaa6bfc4aa6f6a1faefbf21c2c8d1588 (diff) | |
download | linux-d388e541e2e3e26adfd9b1c99144176a73e19f95.tar.gz linux-d388e541e2e3e26adfd9b1c99144176a73e19f95.tar.bz2 linux-d388e541e2e3e26adfd9b1c99144176a73e19f95.zip |
Merge branch 'remotes/lorenzo/pci/host-generic'
- Constify struct pci_ecam_ops (Rob Herring)
- Support building as modules (Rob Herring)
- Eliminate wrappers for pci_host_common_probe() by using DT match table
data (Rob Herring)
* remotes/lorenzo/pci/host-generic:
PCI: host-generic: Eliminate pci_host_common_probe wrappers
PCI: host-generic: Support building as modules
PCI: Constify struct pci_ecam_ops
# Conflicts:
# drivers/pci/controller/dwc/pcie-hisi.c
Diffstat (limited to 'drivers/pci/controller/pci-host-generic.c')
-rw-r--r-- | drivers/pci/controller/pci-host-generic.c | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/drivers/pci/controller/pci-host-generic.c b/drivers/pci/controller/pci-host-generic.c index 75a2fb930d4b..b51977abfdf1 100644 --- a/drivers/pci/controller/pci-host-generic.c +++ b/drivers/pci/controller/pci-host-generic.c @@ -10,12 +10,11 @@ #include <linux/kernel.h> #include <linux/init.h> -#include <linux/of_address.h> -#include <linux/of_pci.h> +#include <linux/module.h> #include <linux/pci-ecam.h> #include <linux/platform_device.h> -static struct pci_ecam_ops gen_pci_cfg_cam_bus_ops = { +static const struct pci_ecam_ops gen_pci_cfg_cam_bus_ops = { .bus_shift = 16, .pci_ops = { .map_bus = pci_ecam_map_bus, @@ -49,7 +48,7 @@ static void __iomem *pci_dw_ecam_map_bus(struct pci_bus *bus, return pci_ecam_map_bus(bus, devfn, where); } -static struct pci_ecam_ops pci_dw_ecam_bus_ops = { +static const struct pci_ecam_ops pci_dw_ecam_bus_ops = { .bus_shift = 20, .pci_ops = { .map_bus = pci_dw_ecam_map_bus, @@ -76,25 +75,16 @@ static const struct of_device_id gen_pci_of_match[] = { { }, }; - -static int gen_pci_probe(struct platform_device *pdev) -{ - const struct of_device_id *of_id; - struct pci_ecam_ops *ops; - - of_id = of_match_node(gen_pci_of_match, pdev->dev.of_node); - ops = (struct pci_ecam_ops *)of_id->data; - - return pci_host_common_probe(pdev, ops); -} +MODULE_DEVICE_TABLE(of, gen_pci_of_match); static struct platform_driver gen_pci_driver = { .driver = { .name = "pci-host-generic", .of_match_table = gen_pci_of_match, - .suppress_bind_attrs = true, }, - .probe = gen_pci_probe, + .probe = pci_host_common_probe, .remove = pci_host_common_remove, }; -builtin_platform_driver(gen_pci_driver); +module_platform_driver(gen_pci_driver); + +MODULE_LICENSE("GPL v2"); |