probe.c (2e483528cebad089d0bb3f9aebb0ada22d968ffa) | probe.c (98d9f30c820d509145757e6ecbc36013aa02f7bc) |
---|---|
1/* 2 * probe.c - PCI detection and setup code 3 */ 4 5#include <linux/kernel.h> 6#include <linux/delay.h> 7#include <linux/init.h> 8#include <linux/pci.h> --- 38 unchanged lines hidden (view full) --- 47 */ 48static void release_pcibus_dev(struct device *dev) 49{ 50 struct pci_bus *pci_bus = to_pci_bus(dev); 51 52 if (pci_bus->bridge) 53 put_device(pci_bus->bridge); 54 pci_bus_remove_resources(pci_bus); | 1/* 2 * probe.c - PCI detection and setup code 3 */ 4 5#include <linux/kernel.h> 6#include <linux/delay.h> 7#include <linux/init.h> 8#include <linux/pci.h> --- 38 unchanged lines hidden (view full) --- 47 */ 48static void release_pcibus_dev(struct device *dev) 49{ 50 struct pci_bus *pci_bus = to_pci_bus(dev); 51 52 if (pci_bus->bridge) 53 put_device(pci_bus->bridge); 54 pci_bus_remove_resources(pci_bus); |
55 pci_release_bus_of_node(pci_bus); |
|
55 kfree(pci_bus); 56} 57 58static struct class pcibus_class = { 59 .name = "pci_bus", 60 .dev_release = &release_pcibus_dev, 61 .dev_attrs = pcibus_dev_attrs, 62}; --- 520 unchanged lines hidden (view full) --- 583 child->primary = parent->secondary; 584 child->subordinate = 0xff; 585 586 if (!bridge) 587 return child; 588 589 child->self = bridge; 590 child->bridge = get_device(&bridge->dev); | 56 kfree(pci_bus); 57} 58 59static struct class pcibus_class = { 60 .name = "pci_bus", 61 .dev_release = &release_pcibus_dev, 62 .dev_attrs = pcibus_dev_attrs, 63}; --- 520 unchanged lines hidden (view full) --- 584 child->primary = parent->secondary; 585 child->subordinate = 0xff; 586 587 if (!bridge) 588 return child; 589 590 child->self = bridge; 591 child->bridge = get_device(&bridge->dev); |
591 | 592 pci_set_bus_of_node(child); |
592 pci_set_bus_speed(child); 593 594 /* Set up default resource pointers and names.. */ 595 for (i = 0; i < PCI_BRIDGE_RESOURCE_NUM; i++) { 596 child->resource[i] = &bridge->resource[PCI_BRIDGE_RESOURCES+i]; 597 child->resource[i]->name = child->name; 598 } 599 bridge->subordinate = child; --- 433 unchanged lines hidden (view full) --- 1033 * done. 1034 */ 1035static void pci_release_dev(struct device *dev) 1036{ 1037 struct pci_dev *pci_dev; 1038 1039 pci_dev = to_pci_dev(dev); 1040 pci_release_capabilities(pci_dev); | 593 pci_set_bus_speed(child); 594 595 /* Set up default resource pointers and names.. */ 596 for (i = 0; i < PCI_BRIDGE_RESOURCE_NUM; i++) { 597 child->resource[i] = &bridge->resource[PCI_BRIDGE_RESOURCES+i]; 598 child->resource[i]->name = child->name; 599 } 600 bridge->subordinate = child; --- 433 unchanged lines hidden (view full) --- 1034 * done. 1035 */ 1036static void pci_release_dev(struct device *dev) 1037{ 1038 struct pci_dev *pci_dev; 1039 1040 pci_dev = to_pci_dev(dev); 1041 pci_release_capabilities(pci_dev); |
1042 pci_release_of_node(pci_dev); |
|
1041 kfree(pci_dev); 1042} 1043 1044/** 1045 * pci_cfg_space_size - get the configuration space size of the PCI device. 1046 * @dev: PCI device 1047 * 1048 * Regular PCI devices have 256 bytes, but PCI-X 2 and PCI Express devices --- 103 unchanged lines hidden (view full) --- 1152 if (!dev) 1153 return NULL; 1154 1155 dev->bus = bus; 1156 dev->devfn = devfn; 1157 dev->vendor = l & 0xffff; 1158 dev->device = (l >> 16) & 0xffff; 1159 | 1043 kfree(pci_dev); 1044} 1045 1046/** 1047 * pci_cfg_space_size - get the configuration space size of the PCI device. 1048 * @dev: PCI device 1049 * 1050 * Regular PCI devices have 256 bytes, but PCI-X 2 and PCI Express devices --- 103 unchanged lines hidden (view full) --- 1154 if (!dev) 1155 return NULL; 1156 1157 dev->bus = bus; 1158 dev->devfn = devfn; 1159 dev->vendor = l & 0xffff; 1160 dev->device = (l >> 16) & 0xffff; 1161 |
1162 pci_set_of_node(dev); 1163 |
|
1160 if (pci_setup_device(dev)) { 1161 kfree(dev); 1162 return NULL; 1163 } 1164 1165 return dev; 1166} 1167 --- 236 unchanged lines hidden (view full) --- 1404 dev->parent = parent; 1405 dev->release = pci_release_bus_bridge_dev; 1406 dev_set_name(dev, "pci%04x:%02x", pci_domain_nr(b), bus); 1407 error = device_register(dev); 1408 if (error) 1409 goto dev_reg_err; 1410 b->bridge = get_device(dev); 1411 device_enable_async_suspend(b->bridge); | 1164 if (pci_setup_device(dev)) { 1165 kfree(dev); 1166 return NULL; 1167 } 1168 1169 return dev; 1170} 1171 --- 236 unchanged lines hidden (view full) --- 1408 dev->parent = parent; 1409 dev->release = pci_release_bus_bridge_dev; 1410 dev_set_name(dev, "pci%04x:%02x", pci_domain_nr(b), bus); 1411 error = device_register(dev); 1412 if (error) 1413 goto dev_reg_err; 1414 b->bridge = get_device(dev); 1415 device_enable_async_suspend(b->bridge); |
1416 pci_set_bus_of_node(b); |
|
1412 1413 if (!parent) 1414 set_dev_node(b->bridge, pcibus_to_node(b)); 1415 1416 b->dev.class = &pcibus_class; 1417 b->dev.parent = b->bridge; 1418 dev_set_name(&b->dev, "%04x:%02x", pci_domain_nr(b), bus); 1419 error = device_register(&b->dev); --- 96 unchanged lines hidden --- | 1417 1418 if (!parent) 1419 set_dev_node(b->bridge, pcibus_to_node(b)); 1420 1421 b->dev.class = &pcibus_class; 1422 b->dev.parent = b->bridge; 1423 dev_set_name(&b->dev, "%04x:%02x", pci_domain_nr(b), bus); 1424 error = device_register(&b->dev); --- 96 unchanged lines hidden --- |