diff options
Diffstat (limited to 'drivers/edac/i7300_edac.c')
| -rw-r--r-- | drivers/edac/i7300_edac.c | 44 | 
1 files changed, 23 insertions, 21 deletions
diff --git a/drivers/edac/i7300_edac.c b/drivers/edac/i7300_edac.c index 9004c64b169..dcac982fdc7 100644 --- a/drivers/edac/i7300_edac.c +++ b/drivers/edac/i7300_edac.c @@ -5,7 +5,7 @@   * GNU General Public License version 2 only.   *   * Copyright (c) 2010 by: - *	 Mauro Carvalho Chehab <mchehab@redhat.com> + *	 Mauro Carvalho Chehab   *   * Red Hat Inc. http://www.redhat.com   * @@ -943,33 +943,35 @@ static int i7300_get_devices(struct mem_ctl_info *mci)  	/* Attempt to 'get' the MCH register we want */  	pdev = NULL; -	while (!pvt->pci_dev_16_1_fsb_addr_map || -	       !pvt->pci_dev_16_2_fsb_err_regs) { -		pdev = pci_get_device(PCI_VENDOR_ID_INTEL, -				      PCI_DEVICE_ID_INTEL_I7300_MCH_ERR, pdev); -		if (!pdev) { -			/* End of list, leave */ -			i7300_printk(KERN_ERR, -				"'system address,Process Bus' " -				"device not found:" -				"vendor 0x%x device 0x%x ERR funcs " -				"(broken BIOS?)\n", -				PCI_VENDOR_ID_INTEL, -				PCI_DEVICE_ID_INTEL_I7300_MCH_ERR); -			goto error; -		} - +	while ((pdev = pci_get_device(PCI_VENDOR_ID_INTEL, +				      PCI_DEVICE_ID_INTEL_I7300_MCH_ERR, +				      pdev))) {  		/* Store device 16 funcs 1 and 2 */  		switch (PCI_FUNC(pdev->devfn)) {  		case 1: -			pvt->pci_dev_16_1_fsb_addr_map = pdev; +			if (!pvt->pci_dev_16_1_fsb_addr_map) +				pvt->pci_dev_16_1_fsb_addr_map = +							pci_dev_get(pdev);  			break;  		case 2: -			pvt->pci_dev_16_2_fsb_err_regs = pdev; +			if (!pvt->pci_dev_16_2_fsb_err_regs) +				pvt->pci_dev_16_2_fsb_err_regs = +							pci_dev_get(pdev);  			break;  		}  	} +	if (!pvt->pci_dev_16_1_fsb_addr_map || +	    !pvt->pci_dev_16_2_fsb_err_regs) { +		/* At least one device was not found */ +		i7300_printk(KERN_ERR, +			"'system address,Process Bus' device not found:" +			"vendor 0x%x device 0x%x ERR funcs (broken BIOS?)\n", +			PCI_VENDOR_ID_INTEL, +			PCI_DEVICE_ID_INTEL_I7300_MCH_ERR); +		goto error; +	} +  	edac_dbg(1, "System Address, processor bus- PCI Bus ID: %s  %x:%x\n",  		 pci_name(pvt->pci_dev_16_0_fsb_ctlr),  		 pvt->pci_dev_16_0_fsb_ctlr->vendor, @@ -1160,7 +1162,7 @@ static void i7300_remove_one(struct pci_dev *pdev)   *   * Has only 8086:360c PCI ID   */ -static DEFINE_PCI_DEVICE_TABLE(i7300_pci_tbl) = { +static const struct pci_device_id i7300_pci_tbl[] = {  	{PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_I7300_MCH_ERR)},  	{0,}			/* 0 terminated list. */  }; @@ -1207,7 +1209,7 @@ module_init(i7300_init);  module_exit(i7300_exit);  MODULE_LICENSE("GPL"); -MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@redhat.com>"); +MODULE_AUTHOR("Mauro Carvalho Chehab");  MODULE_AUTHOR("Red Hat Inc. (http://www.redhat.com)");  MODULE_DESCRIPTION("MC Driver for Intel I7300 memory controllers - "  		   I7300_REVISION);  | 
