i82875p_edac: Assign PCI resources before adding device
authorYinghai Lu <yinghai@kernel.org>
Tue, 7 May 2013 23:29:31 +0000 (16:29 -0700)
committerBjorn Helgaas <bhelgaas@google.com>
Fri, 30 May 2014 16:56:46 +0000 (10:56 -0600)
Assign PCI resources before pci_bus_add_device().  The resources must be
assigned before a driver can claim the device.

[bhelgaas: changelog]
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/edac/i82875p_edac.c

index 8d0450b9b9af42e5b4db08ab68b94f44a971a0ae..f2b9ac9ed9f391ed60c9e7c702161060f0498c9e 100644 (file)
@@ -293,13 +293,14 @@ static int i82875p_setup_overfl_dev(struct pci_dev *pdev,
                if (dev == NULL)
                        return 1;
 
+               pci_bus_assign_resources(dev->bus);
+
                err = pci_bus_add_device(dev);
                if (err) {
                        i82875p_printk(KERN_ERR,
                                "%s(): pci_bus_add_device() Failed\n",
                                __func__);
                }
-               pci_bus_assign_resources(dev->bus);
        }
 
        *ovrfl_pdev = dev;