Skip to content

Commit 7adf6ac

Browse files
rbmarlierebjorn-helgaas
authored andcommitted
PCI: Make pcie_port_bus_type const
Now that the driver core can properly handle constant struct bus_type, move the pcie_port_bus_type variable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime. Link: https://lore.kernel.org/r/[email protected] Suggested-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Ricardo B. Marliere <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
1 parent 6613476 commit 7adf6ac

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/pci/pci-driver.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1714,7 +1714,7 @@ static int pcie_port_bus_match(struct device *dev, struct device_driver *drv)
17141714
return 1;
17151715
}
17161716

1717-
struct bus_type pcie_port_bus_type = {
1717+
const struct bus_type pcie_port_bus_type = {
17181718
.name = "pci_express",
17191719
.match = pcie_port_bus_match,
17201720
};

drivers/pci/pcie/portdrv.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ struct pcie_port_service_driver {
9696
int pcie_port_service_register(struct pcie_port_service_driver *new);
9797
void pcie_port_service_unregister(struct pcie_port_service_driver *new);
9898

99-
extern struct bus_type pcie_port_bus_type;
99+
extern const struct bus_type pcie_port_bus_type;
100100

101101
struct pci_dev;
102102

0 commit comments

Comments
 (0)