hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/pci/hotplug/rpadlpar_core.c
....@@ -40,13 +40,13 @@
4040 static struct device_node *find_vio_slot_node(char *drc_name)
4141 {
4242 struct device_node *parent = of_find_node_by_name(NULL, "vdevice");
43
- struct device_node *dn = NULL;
43
+ struct device_node *dn;
4444 int rc;
4545
4646 if (!parent)
4747 return NULL;
4848
49
- while ((dn = of_get_next_child(parent, dn))) {
49
+ for_each_child_of_node(parent, dn) {
5050 rc = rpaphp_check_drc_props(dn, drc_name, NULL);
5151 if (rc == 0)
5252 break;
....@@ -60,10 +60,10 @@
6060 static struct device_node *find_php_slot_pci_node(char *drc_name,
6161 char *drc_type)
6262 {
63
- struct device_node *np = NULL;
63
+ struct device_node *np;
6464 int rc;
6565
66
- while ((np = of_find_node_by_name(np, "pci"))) {
66
+ for_each_node_by_name(np, "pci") {
6767 rc = rpaphp_check_drc_props(np, drc_name, drc_type);
6868 if (rc == 0)
6969 break;
....@@ -140,7 +140,7 @@
140140 struct pci_controller *phb = pdn->phb;
141141 struct pci_dev *dev = NULL;
142142
143
- eeh_add_device_tree_early(pdn);
143
+ pseries_eeh_init_edev_recursive(pdn);
144144
145145 /* Add EADS device to PHB bus, adding new entry to bus->devices */
146146 dev = of_create_pci_dev(dn, phb->bus, pdn->devfn);
....@@ -352,7 +352,7 @@
352352 * -ENODEV Not a valid drc_name
353353 * -EIO Internal PCI Error
354354 */
355
-int dlpar_remove_pci_slot(char *drc_name, struct device_node *dn)
355
+static int dlpar_remove_pci_slot(char *drc_name, struct device_node *dn)
356356 {
357357 struct pci_bus *bus;
358358 struct slot *slot;
....@@ -458,7 +458,7 @@
458458 return (int) (rc != RTAS_UNKNOWN_SERVICE);
459459 }
460460
461
-int __init rpadlpar_io_init(void)
461
+static int __init rpadlpar_io_init(void)
462462 {
463463
464464 if (!is_dlpar_capable()) {
....@@ -470,10 +470,9 @@
470470 return dlpar_sysfs_init();
471471 }
472472
473
-void rpadlpar_io_exit(void)
473
+static void __exit rpadlpar_io_exit(void)
474474 {
475475 dlpar_sysfs_exit();
476
- return;
477476 }
478477
479478 module_init(rpadlpar_io_init);