Patchwork PCI, EDAC: fix ordering assign resource and bus_add

login
register
mail settings
Submitter Yinghai Lu
Date May 7, 2013, 11:29 p.m.
Message ID <1367969371-27414-1-git-send-email-yinghai@kernel.org>
Download mbox | patch
Permalink /patch/242480/
State Not Applicable
Headers show

Comments

Yinghai Lu - May 7, 2013, 11:29 p.m.
We should assign unassigned resource before pci_bus_add_device.

as late one will enable driver and create sysfs file that will need
pci io resources from assign unassigned code.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>

---
 drivers/edac/i82875p_edac.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

Index: linux-2.6/drivers/edac/i82875p_edac.c
===================================================================
--- linux-2.6.orig/drivers/edac/i82875p_edac.c
+++ linux-2.6/drivers/edac/i82875p_edac.c
@@ -293,13 +293,14 @@  static int i82875p_setup_overfl_dev(stru
 		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;