diff options
Diffstat (limited to 'drivers/pci/hotplug/fakephp.c')
-rw-r--r-- | drivers/pci/hotplug/fakephp.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/drivers/pci/hotplug/fakephp.c b/drivers/pci/hotplug/fakephp.c index dd2b762777c4..05a4f0f90186 100644 --- a/drivers/pci/hotplug/fakephp.c +++ b/drivers/pci/hotplug/fakephp.c | |||
@@ -176,7 +176,9 @@ static void pci_rescan_slot(struct pci_dev *temp) | |||
176 | struct pci_bus *bus = temp->bus; | 176 | struct pci_bus *bus = temp->bus; |
177 | struct pci_dev *dev; | 177 | struct pci_dev *dev; |
178 | int func; | 178 | int func; |
179 | int retval; | ||
179 | u8 hdr_type; | 180 | u8 hdr_type; |
181 | |||
180 | if (!pci_read_config_byte(temp, PCI_HEADER_TYPE, &hdr_type)) { | 182 | if (!pci_read_config_byte(temp, PCI_HEADER_TYPE, &hdr_type)) { |
181 | temp->hdr_type = hdr_type & 0x7f; | 183 | temp->hdr_type = hdr_type & 0x7f; |
182 | if (!pci_find_slot(bus->number, temp->devfn)) { | 184 | if (!pci_find_slot(bus->number, temp->devfn)) { |
@@ -185,8 +187,12 @@ static void pci_rescan_slot(struct pci_dev *temp) | |||
185 | dbg("New device on %s function %x:%x\n", | 187 | dbg("New device on %s function %x:%x\n", |
186 | bus->name, temp->devfn >> 3, | 188 | bus->name, temp->devfn >> 3, |
187 | temp->devfn & 7); | 189 | temp->devfn & 7); |
188 | pci_bus_add_device(dev); | 190 | retval = pci_bus_add_device(dev); |
189 | add_slot(dev); | 191 | if (retval) |
192 | dev_err(&dev->dev, "error adding " | ||
193 | "device, continuing.\n"); | ||
194 | else | ||
195 | add_slot(dev); | ||
190 | } | 196 | } |
191 | } | 197 | } |
192 | /* multifunction device? */ | 198 | /* multifunction device? */ |
@@ -205,8 +211,12 @@ static void pci_rescan_slot(struct pci_dev *temp) | |||
205 | dbg("New device on %s function %x:%x\n", | 211 | dbg("New device on %s function %x:%x\n", |
206 | bus->name, temp->devfn >> 3, | 212 | bus->name, temp->devfn >> 3, |
207 | temp->devfn & 7); | 213 | temp->devfn & 7); |
208 | pci_bus_add_device(dev); | 214 | retval = pci_bus_add_device(dev); |
209 | add_slot(dev); | 215 | if (retval) |
216 | dev_err(&dev->dev, "error adding " | ||
217 | "device, continuing.\n"); | ||
218 | else | ||
219 | add_slot(dev); | ||
210 | } | 220 | } |
211 | } | 221 | } |
212 | } | 222 | } |