Commit 806669fc authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

[PATCH] PCI: remove all struct device.name usage from the PCI core code.

This is because that field is going away shortly...
parent defec5af
...@@ -56,7 +56,7 @@ void __devinit pci_name_device(struct pci_dev *dev) ...@@ -56,7 +56,7 @@ void __devinit pci_name_device(struct pci_dev *dev)
{ {
const struct pci_vendor_info *vendor_p = pci_vendor_list; const struct pci_vendor_info *vendor_p = pci_vendor_list;
int i = VENDORS; int i = VENDORS;
char *name = dev->dev.name; char *name = dev->pretty_name;
do { do {
if (vendor_p->vendor == dev->vendor) if (vendor_p->vendor == dev->vendor)
......
...@@ -69,7 +69,7 @@ static void pci_read_bases(struct pci_dev *dev, unsigned int howmany, int rom) ...@@ -69,7 +69,7 @@ static void pci_read_bases(struct pci_dev *dev, unsigned int howmany, int rom)
for(pos=0; pos<howmany; pos = next) { for(pos=0; pos<howmany; pos = next) {
next = pos+1; next = pos+1;
res = &dev->resource[pos]; res = &dev->resource[pos];
res->name = dev->dev.name; res->name = pci_name(dev);
reg = PCI_BASE_ADDRESS_0 + (pos << 2); reg = PCI_BASE_ADDRESS_0 + (pos << 2);
pci_read_config_dword(dev, reg, &l); pci_read_config_dword(dev, reg, &l);
pci_write_config_dword(dev, reg, ~0); pci_write_config_dword(dev, reg, ~0);
...@@ -120,7 +120,7 @@ static void pci_read_bases(struct pci_dev *dev, unsigned int howmany, int rom) ...@@ -120,7 +120,7 @@ static void pci_read_bases(struct pci_dev *dev, unsigned int howmany, int rom)
if (rom) { if (rom) {
dev->rom_base_reg = rom; dev->rom_base_reg = rom;
res = &dev->resource[PCI_ROM_RESOURCE]; res = &dev->resource[PCI_ROM_RESOURCE];
res->name = dev->dev.name; res->name = pci_name(dev);
pci_read_config_dword(dev, rom, &l); pci_read_config_dword(dev, rom, &l);
pci_write_config_dword(dev, rom, ~PCI_ROM_ADDRESS_ENABLE); pci_write_config_dword(dev, rom, ~PCI_ROM_ADDRESS_ENABLE);
pci_read_config_dword(dev, rom, &sz); pci_read_config_dword(dev, rom, &sz);
...@@ -153,7 +153,7 @@ void __devinit pci_read_bridge_bases(struct pci_bus *child) ...@@ -153,7 +153,7 @@ void __devinit pci_read_bridge_bases(struct pci_bus *child)
return; return;
if (dev->transparent) { if (dev->transparent) {
printk("Transparent bridge - %s\n", dev->dev.name); printk("Transparent bridge - %s\n", pci_name(dev));
for(i = 0; i < PCI_BUS_NUM_RESOURCES; i++) for(i = 0; i < PCI_BUS_NUM_RESOURCES; i++)
child->resource[i] = child->parent->resource[i]; child->resource[i] = child->parent->resource[i];
return; return;
...@@ -406,8 +406,6 @@ static int pci_setup_device(struct pci_dev * dev) ...@@ -406,8 +406,6 @@ static int pci_setup_device(struct pci_dev * dev)
dev->slot_name = dev->dev.bus_id; dev->slot_name = dev->dev.bus_id;
sprintf(pci_name(dev), "%04x:%02x:%02x.%d", pci_domain_nr(dev->bus), sprintf(pci_name(dev), "%04x:%02x:%02x.%d", pci_domain_nr(dev->bus),
dev->bus->number, PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn)); dev->bus->number, PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn));
sprintf(dev->dev.name, "PCI device %04x:%04x",
dev->vendor, dev->device);
INIT_LIST_HEAD(&dev->pools); INIT_LIST_HEAD(&dev->pools);
...@@ -663,7 +661,6 @@ struct pci_bus * __devinit pci_scan_bus_parented(struct device *parent, int bus, ...@@ -663,7 +661,6 @@ struct pci_bus * __devinit pci_scan_bus_parented(struct device *parent, int bus,
memset(b->dev,0,sizeof(*(b->dev))); memset(b->dev,0,sizeof(*(b->dev)));
b->dev->parent = parent; b->dev->parent = parent;
sprintf(b->dev->bus_id,"pci%04x:%02x", pci_domain_nr(b), bus); sprintf(b->dev->bus_id,"pci%04x:%02x", pci_domain_nr(b), bus);
strcpy(b->dev->name,"Host/PCI Bridge");
device_register(b->dev); device_register(b->dev);
b->number = b->secondary = bus; b->number = b->secondary = bus;
......
...@@ -483,7 +483,12 @@ static int show_dev_config(struct seq_file *m, void *v) ...@@ -483,7 +483,12 @@ static int show_dev_config(struct seq_file *m, void *v)
seq_printf(m, " %s", class); seq_printf(m, " %s", class);
else else
seq_printf(m, " Class %04x", class_rev >> 16); seq_printf(m, " Class %04x", class_rev >> 16);
seq_printf(m, ": %s (rev %d).\n", dev->dev.name, class_rev & 0xff); #ifdef CONFIG_PCI_NAMES
seq_printf(m, ": %s", dev->pretty_name);
#else
seq_printf(m, ": PCI device %04x:%04x", dev->vendor, dev->device);
#endif
seq_printf(m, " (rev %d).\n", class_rev & 0xff);
if (dev->irq) if (dev->irq)
seq_printf(m, " IRQ %d.\n", dev->irq); seq_printf(m, " IRQ %d.\n", dev->irq);
......
...@@ -219,7 +219,7 @@ static void __devinit quirk_io_region(struct pci_dev *dev, unsigned region, unsi ...@@ -219,7 +219,7 @@ static void __devinit quirk_io_region(struct pci_dev *dev, unsigned region, unsi
if (region) { if (region) {
struct resource *res = dev->resource + nr; struct resource *res = dev->resource + nr;
res->name = dev->dev.name; res->name = pci_name(dev);
res->start = region; res->start = region;
res->end = region + size - 1; res->end = region + size - 1;
res->flags = IORESOURCE_IO; res->flags = IORESOURCE_IO;
......
...@@ -141,7 +141,7 @@ pci_setup_bridge(struct pci_bus *bus) ...@@ -141,7 +141,7 @@ pci_setup_bridge(struct pci_bus *bus)
u32 l; u32 l;
DBGC((KERN_INFO "PCI: Bus %d, bridge: %s\n", DBGC((KERN_INFO "PCI: Bus %d, bridge: %s\n",
bus->number, bridge->dev.name)); bus->number, pci_name(bridge)));
/* Set up the top and bottom of the PCI I/O segment for this bus. */ /* Set up the top and bottom of the PCI I/O segment for this bus. */
pcibios_resource_to_bus(bridge, &region, bus->resource[0]); pcibios_resource_to_bus(bridge, &region, bus->resource[0]);
......
...@@ -166,7 +166,7 @@ pdev_sort_resources(struct pci_dev *dev, struct resource_list *head) ...@@ -166,7 +166,7 @@ pdev_sort_resources(struct pci_dev *dev, struct resource_list *head)
if (!r_align) { if (!r_align) {
printk(KERN_WARNING "PCI: Ignore bogus resource %d " printk(KERN_WARNING "PCI: Ignore bogus resource %d "
"[%lx:%lx] of %s\n", "[%lx:%lx] of %s\n",
i, r->start, r->end, dev->dev.name); i, r->start, r->end, pci_name(dev));
continue; continue;
} }
r_align = (i < PCI_BRIDGE_RESOURCES) ? r_align + 1 : r->start; r_align = (i < PCI_BRIDGE_RESOURCES) ? r_align + 1 : r->start;
......
...@@ -419,6 +419,9 @@ struct pci_dev { ...@@ -419,6 +419,9 @@ struct pci_dev {
/* These fields are used by common fixups */ /* These fields are used by common fixups */
unsigned int transparent:1; /* Transparent PCI bridge */ unsigned int transparent:1; /* Transparent PCI bridge */
unsigned int multifunction:1;/* Part of multi-function device */ unsigned int multifunction:1;/* Part of multi-function device */
#ifdef CONFIG_PCI_NAMES
char pretty_name[DEVICE_NAME_SIZE]; /* pretty name for users to see */
#endif
}; };
#define pci_dev_g(n) list_entry(n, struct pci_dev, global_list) #define pci_dev_g(n) list_entry(n, struct pci_dev, global_list)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment