.. | .. |
---|
1 | 1 | // SPDX-License-Identifier: GPL-2.0 |
---|
2 | 2 | /* |
---|
3 | | - * Simple, generic PCI host controller driver targetting firmware-initialised |
---|
| 3 | + * Simple, generic PCI host controller driver targeting firmware-initialised |
---|
4 | 4 | * systems and virtual machines (e.g. the PCI emulation provided by kvmtool). |
---|
5 | 5 | * |
---|
6 | 6 | * Copyright (C) 2014 ARM Limited |
---|
.. | .. |
---|
10 | 10 | |
---|
11 | 11 | #include <linux/kernel.h> |
---|
12 | 12 | #include <linux/init.h> |
---|
13 | | -#include <linux/of_address.h> |
---|
14 | | -#include <linux/of_pci.h> |
---|
| 13 | +#include <linux/module.h> |
---|
15 | 14 | #include <linux/pci-ecam.h> |
---|
16 | 15 | #include <linux/platform_device.h> |
---|
17 | 16 | |
---|
18 | | -static struct pci_ecam_ops gen_pci_cfg_cam_bus_ops = { |
---|
| 17 | +static const struct pci_ecam_ops gen_pci_cfg_cam_bus_ops = { |
---|
19 | 18 | .bus_shift = 16, |
---|
20 | 19 | .pci_ops = { |
---|
21 | 20 | .map_bus = pci_ecam_map_bus, |
---|
.. | .. |
---|
49 | 48 | return pci_ecam_map_bus(bus, devfn, where); |
---|
50 | 49 | } |
---|
51 | 50 | |
---|
52 | | -static struct pci_ecam_ops pci_dw_ecam_bus_ops = { |
---|
| 51 | +static const struct pci_ecam_ops pci_dw_ecam_bus_ops = { |
---|
53 | 52 | .bus_shift = 20, |
---|
54 | 53 | .pci_ops = { |
---|
55 | 54 | .map_bus = pci_dw_ecam_map_bus, |
---|
.. | .. |
---|
76 | 75 | |
---|
77 | 76 | { }, |
---|
78 | 77 | }; |
---|
79 | | - |
---|
80 | | -static int gen_pci_probe(struct platform_device *pdev) |
---|
81 | | -{ |
---|
82 | | - const struct of_device_id *of_id; |
---|
83 | | - struct pci_ecam_ops *ops; |
---|
84 | | - |
---|
85 | | - of_id = of_match_node(gen_pci_of_match, pdev->dev.of_node); |
---|
86 | | - ops = (struct pci_ecam_ops *)of_id->data; |
---|
87 | | - |
---|
88 | | - return pci_host_common_probe(pdev, ops); |
---|
89 | | -} |
---|
| 78 | +MODULE_DEVICE_TABLE(of, gen_pci_of_match); |
---|
90 | 79 | |
---|
91 | 80 | static struct platform_driver gen_pci_driver = { |
---|
92 | 81 | .driver = { |
---|
93 | 82 | .name = "pci-host-generic", |
---|
94 | 83 | .of_match_table = gen_pci_of_match, |
---|
95 | | - .suppress_bind_attrs = true, |
---|
96 | 84 | }, |
---|
97 | | - .probe = gen_pci_probe, |
---|
| 85 | + .probe = pci_host_common_probe, |
---|
98 | 86 | .remove = pci_host_common_remove, |
---|
99 | 87 | }; |
---|
100 | | -builtin_platform_driver(gen_pci_driver); |
---|
| 88 | +module_platform_driver(gen_pci_driver); |
---|
| 89 | + |
---|
| 90 | +MODULE_LICENSE("GPL v2"); |
---|