aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2008-06-27 08:23:20 -0400
committerJesse Barnes <jbarnes@virtuousgeek.org>2008-06-27 16:09:02 -0400
commit8b285ce84bbc719e363a796f466404576b840d36 (patch)
tree05fb0faca73afc594f9dca60f4b2be742b0d60ae
parent9433f6dd3a4677e9b92c6e1cd7f98b11598b7c2c (diff)
PCI: fix pci_setup_device()'s sprinting into a const buffer
Make pci_setup_device() write the bus ID directly into the allotted storage, rather than using pci_name() as the address as that now returns a const pointer. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
-rw-r--r--drivers/pci/probe.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index f8291191ef91..0420fd8027b6 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -713,8 +713,9 @@ static int pci_setup_device(struct pci_dev * dev)
713{ 713{
714 u32 class; 714 u32 class;
715 715
716 sprintf(pci_name(dev), "%04x:%02x:%02x.%d", pci_domain_nr(dev->bus), 716 snprintf(dev->dev.bus_id, BUS_ID_SIZE,
717 dev->bus->number, PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn)); 717 "%04x:%02x:%02x.%d", pci_domain_nr(dev->bus),
718 dev->bus->number, PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn));
718 719
719 pci_read_config_dword(dev, PCI_CLASS_REVISION, &class); 720 pci_read_config_dword(dev, PCI_CLASS_REVISION, &class);
720 dev->revision = class & 0xff; 721 dev->revision = class & 0xff;