return -ENODEV;
}
- i7core_printk(KERN_INFO,
- "Registered socket %d "
- "dev %02x:%02x.%d PCI ID %04x:%04x\n",
- socket, bus, pci_dev_descr[devno].dev, pci_dev_descr[devno].func,
- PCI_VENDOR_ID_INTEL, pci_dev_descr[devno].dev_id);
+ debugf0("Detected socket %d dev %02x:%02x.%d PCI ID %04x:%04x\n",
+ socket, bus, pci_dev_descr[devno].dev,
+ pci_dev_descr[devno].func,
+ PCI_VENDOR_ID_INTEL, pci_dev_descr[devno].dev_id);
*prev = pdev;
int rc;
/* allocate a new MC control structure */
- mci = edac_mc_alloc(sizeof(*pvt), num_csrows, num_channels, 0);
+ mci = edac_mc_alloc(sizeof(*pvt), num_csrows, num_channels,
+ i7core_dev->socket);
if (unlikely(!mci))
return -ENOMEM;
pvt = mci->pvt_info;
memset(pvt, 0, sizeof(*pvt));
- mci->mc_idx = 0;
/*
* FIXME: how to handle RDDR3 at MCI level? It is possible to have
struct i7core_dev *i7core_dev;
/*
- * FIXME: All memory controllers are allocated at the first pass.
+ * All memory controllers are allocated at the first pass.
*/
if (unlikely(dev_idx >= 1))
return -EINVAL;
if (unlikely(rc < 0))
goto fail1;
- i7core_register_mci(i7core_dev, channels, csrows);
+ rc = i7core_register_mci(i7core_dev, channels, csrows);
+ if (unlikely(rc < 0))
+ goto fail1;
}
i7core_printk(KERN_INFO, "Driver loaded.\n");
/* retrieve references to resources, and free those resources */
mutex_lock(&i7core_edac_lock);
+
+ /* FIXME: This should put the devices only for this mci!!! */
i7core_put_devices();
mutex_unlock(&i7core_edac_lock);