diff options
Diffstat (limited to 'drivers/pci/probe.c')
| -rw-r--r-- | drivers/pci/probe.c | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 3706ce7972dd..b1724cf31b66 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c | |||
| @@ -277,8 +277,8 @@ static void pci_read_bases(struct pci_dev *dev, unsigned int howmany, int rom) | |||
| 277 | res->end = res->start + sz64; | 277 | res->end = res->start + sz64; |
| 278 | #else | 278 | #else |
| 279 | if (sz64 > 0x100000000ULL) { | 279 | if (sz64 > 0x100000000ULL) { |
| 280 | printk(KERN_ERR "PCI: Unable to handle 64-bit " | 280 | dev_err(&dev->dev, "BAR %d: can't handle 64-bit" |
| 281 | "BAR for device %s\n", pci_name(dev)); | 281 | " BAR\n", pos); |
| 282 | res->start = 0; | 282 | res->start = 0; |
| 283 | res->flags = 0; | 283 | res->flags = 0; |
| 284 | } else if (lhi) { | 284 | } else if (lhi) { |
| @@ -329,7 +329,7 @@ void __devinit pci_read_bridge_bases(struct pci_bus *child) | |||
| 329 | return; | 329 | return; |
| 330 | 330 | ||
| 331 | if (dev->transparent) { | 331 | if (dev->transparent) { |
| 332 | printk(KERN_INFO "PCI: Transparent bridge - %s\n", pci_name(dev)); | 332 | dev_info(&dev->dev, "transparent bridge\n"); |
| 333 | for(i = 3; i < PCI_BUS_NUM_RESOURCES; i++) | 333 | for(i = 3; i < PCI_BUS_NUM_RESOURCES; i++) |
| 334 | child->resource[i] = child->parent->resource[i - 3]; | 334 | child->resource[i] = child->parent->resource[i - 3]; |
| 335 | } | 335 | } |
| @@ -392,7 +392,8 @@ void __devinit pci_read_bridge_bases(struct pci_bus *child) | |||
| 392 | limit |= ((long) mem_limit_hi) << 32; | 392 | limit |= ((long) mem_limit_hi) << 32; |
| 393 | #else | 393 | #else |
| 394 | if (mem_base_hi || mem_limit_hi) { | 394 | if (mem_base_hi || mem_limit_hi) { |
| 395 | printk(KERN_ERR "PCI: Unable to handle 64-bit address space for bridge %s\n", pci_name(dev)); | 395 | dev_err(&dev->dev, "can't handle 64-bit " |
| 396 | "address space for bridge\n"); | ||
| 396 | return; | 397 | return; |
| 397 | } | 398 | } |
| 398 | #endif | 399 | #endif |
| @@ -414,6 +415,7 @@ static struct pci_bus * pci_alloc_bus(void) | |||
| 414 | INIT_LIST_HEAD(&b->node); | 415 | INIT_LIST_HEAD(&b->node); |
| 415 | INIT_LIST_HEAD(&b->children); | 416 | INIT_LIST_HEAD(&b->children); |
| 416 | INIT_LIST_HEAD(&b->devices); | 417 | INIT_LIST_HEAD(&b->devices); |
| 418 | INIT_LIST_HEAD(&b->slots); | ||
| 417 | } | 419 | } |
| 418 | return b; | 420 | return b; |
| 419 | } | 421 | } |
| @@ -511,8 +513,8 @@ int __devinit pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max, | |||
| 511 | 513 | ||
| 512 | pci_read_config_dword(dev, PCI_PRIMARY_BUS, &buses); | 514 | pci_read_config_dword(dev, PCI_PRIMARY_BUS, &buses); |
| 513 | 515 | ||
| 514 | pr_debug("PCI: Scanning behind PCI bridge %s, config %06x, pass %d\n", | 516 | dev_dbg(&dev->dev, "scanning behind bridge, config %06x, pass %d\n", |
| 515 | pci_name(dev), buses & 0xffffff, pass); | 517 | buses & 0xffffff, pass); |
| 516 | 518 | ||
| 517 | /* Disable MasterAbortMode during probing to avoid reporting | 519 | /* Disable MasterAbortMode during probing to avoid reporting |
| 518 | of bus errors (in some architectures) */ | 520 | of bus errors (in some architectures) */ |
| @@ -535,8 +537,8 @@ int __devinit pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max, | |||
| 535 | * ignore it. This can happen with the i450NX chipset. | 537 | * ignore it. This can happen with the i450NX chipset. |
| 536 | */ | 538 | */ |
| 537 | if (pci_find_bus(pci_domain_nr(bus), busnr)) { | 539 | if (pci_find_bus(pci_domain_nr(bus), busnr)) { |
| 538 | printk(KERN_INFO "PCI: Bus %04x:%02x already known\n", | 540 | dev_info(&dev->dev, "bus %04x:%02x already known\n", |
| 539 | pci_domain_nr(bus), busnr); | 541 | pci_domain_nr(bus), busnr); |
| 540 | goto out; | 542 | goto out; |
| 541 | } | 543 | } |
| 542 | 544 | ||
| @@ -711,8 +713,9 @@ static int pci_setup_device(struct pci_dev * dev) | |||
| 711 | { | 713 | { |
| 712 | u32 class; | 714 | u32 class; |
| 713 | 715 | ||
| 714 | sprintf(pci_name(dev), "%04x:%02x:%02x.%d", pci_domain_nr(dev->bus), | 716 | dev_set_name(&dev->dev, "%04x:%02x:%02x.%d", pci_domain_nr(dev->bus), |
| 715 | dev->bus->number, PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn)); | 717 | dev->bus->number, PCI_SLOT(dev->devfn), |
| 718 | PCI_FUNC(dev->devfn)); | ||
| 716 | 719 | ||
| 717 | pci_read_config_dword(dev, PCI_CLASS_REVISION, &class); | 720 | pci_read_config_dword(dev, PCI_CLASS_REVISION, &class); |
| 718 | dev->revision = class & 0xff; | 721 | dev->revision = class & 0xff; |
| @@ -720,7 +723,7 @@ static int pci_setup_device(struct pci_dev * dev) | |||
| 720 | dev->class = class; | 723 | dev->class = class; |
| 721 | class >>= 8; | 724 | class >>= 8; |
| 722 | 725 | ||
| 723 | pr_debug("PCI: Found %s [%04x/%04x] %06x %02x\n", pci_name(dev), | 726 | dev_dbg(&dev->dev, "found [%04x/%04x] class %06x header type %02x\n", |
| 724 | dev->vendor, dev->device, class, dev->hdr_type); | 727 | dev->vendor, dev->device, class, dev->hdr_type); |
| 725 | 728 | ||
| 726 | /* "Unknown power state" */ | 729 | /* "Unknown power state" */ |
| @@ -788,13 +791,13 @@ static int pci_setup_device(struct pci_dev * dev) | |||
| 788 | break; | 791 | break; |
| 789 | 792 | ||
| 790 | default: /* unknown header */ | 793 | default: /* unknown header */ |
| 791 | printk(KERN_ERR "PCI: device %s has unknown header type %02x, ignoring.\n", | 794 | dev_err(&dev->dev, "unknown header type %02x, " |
| 792 | pci_name(dev), dev->hdr_type); | 795 | "ignoring device\n", dev->hdr_type); |
| 793 | return -1; | 796 | return -1; |
| 794 | 797 | ||
| 795 | bad: | 798 | bad: |
| 796 | printk(KERN_ERR "PCI: %s: class %x doesn't match header type %02x. Ignoring class.\n", | 799 | dev_err(&dev->dev, "ignoring class %02x (doesn't match header " |
| 797 | pci_name(dev), class, dev->hdr_type); | 800 | "type %02x)\n", class, dev->hdr_type); |
| 798 | dev->class = PCI_CLASS_NOT_DEFINED; | 801 | dev->class = PCI_CLASS_NOT_DEFINED; |
| 799 | } | 802 | } |
| 800 | 803 | ||
| @@ -927,7 +930,7 @@ static struct pci_dev *pci_scan_device(struct pci_bus *bus, int devfn) | |||
| 927 | return NULL; | 930 | return NULL; |
| 928 | /* Card hasn't responded in 60 seconds? Must be stuck. */ | 931 | /* Card hasn't responded in 60 seconds? Must be stuck. */ |
| 929 | if (delay > 60 * 1000) { | 932 | if (delay > 60 * 1000) { |
| 930 | printk(KERN_WARNING "Device %04x:%02x:%02x.%d not " | 933 | printk(KERN_WARNING "pci %04x:%02x:%02x.%d: not " |
| 931 | "responding\n", pci_domain_nr(bus), | 934 | "responding\n", pci_domain_nr(bus), |
| 932 | bus->number, PCI_SLOT(devfn), | 935 | bus->number, PCI_SLOT(devfn), |
| 933 | PCI_FUNC(devfn)); | 936 | PCI_FUNC(devfn)); |
| @@ -984,6 +987,9 @@ void pci_device_add(struct pci_dev *dev, struct pci_bus *bus) | |||
| 984 | /* Fix up broken headers */ | 987 | /* Fix up broken headers */ |
| 985 | pci_fixup_device(pci_fixup_header, dev); | 988 | pci_fixup_device(pci_fixup_header, dev); |
| 986 | 989 | ||
| 990 | /* Initialize power management of the device */ | ||
| 991 | pci_pm_init(dev); | ||
| 992 | |||
| 987 | /* | 993 | /* |
| 988 | * Add the device to our list of discovered devices | 994 | * Add the device to our list of discovered devices |
| 989 | * and the bus list for fixup functions, etc. | 995 | * and the bus list for fixup functions, etc. |
