hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/pci/controller/pci-host-generic.c
....@@ -1,6 +1,6 @@
11 // SPDX-License-Identifier: GPL-2.0
22 /*
3
- * Simple, generic PCI host controller driver targetting firmware-initialised
3
+ * Simple, generic PCI host controller driver targeting firmware-initialised
44 * systems and virtual machines (e.g. the PCI emulation provided by kvmtool).
55 *
66 * Copyright (C) 2014 ARM Limited
....@@ -10,12 +10,11 @@
1010
1111 #include <linux/kernel.h>
1212 #include <linux/init.h>
13
-#include <linux/of_address.h>
14
-#include <linux/of_pci.h>
13
+#include <linux/module.h>
1514 #include <linux/pci-ecam.h>
1615 #include <linux/platform_device.h>
1716
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 = {
1918 .bus_shift = 16,
2019 .pci_ops = {
2120 .map_bus = pci_ecam_map_bus,
....@@ -49,7 +48,7 @@
4948 return pci_ecam_map_bus(bus, devfn, where);
5049 }
5150
52
-static struct pci_ecam_ops pci_dw_ecam_bus_ops = {
51
+static const struct pci_ecam_ops pci_dw_ecam_bus_ops = {
5352 .bus_shift = 20,
5453 .pci_ops = {
5554 .map_bus = pci_dw_ecam_map_bus,
....@@ -76,25 +75,16 @@
7675
7776 { },
7877 };
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);
9079
9180 static struct platform_driver gen_pci_driver = {
9281 .driver = {
9382 .name = "pci-host-generic",
9483 .of_match_table = gen_pci_of_match,
95
- .suppress_bind_attrs = true,
9684 },
97
- .probe = gen_pci_probe,
85
+ .probe = pci_host_common_probe,
9886 .remove = pci_host_common_remove,
9987 };
100
-builtin_platform_driver(gen_pci_driver);
88
+module_platform_driver(gen_pci_driver);
89
+
90
+MODULE_LICENSE("GPL v2");