Beispiel #1
0
/*
 * edac_init
 *      module initialization entry point
 */
static int __init edac_init(void)
{
	int err = 0;

	edac_printk(KERN_INFO, EDAC_MC, EDAC_VERSION "\n");

	/*
	 * Harvest and clear any boot/initialization PCI parity errors
	 *
	 * FIXME: This only clears errors logged by devices present at time of
	 *      module initialization.  We should also do an initial clear
	 *      of each newly hotplugged device.
	 */
	edac_pci_clear_parity_errors();

	err = edac_mc_sysfs_init();
	if (err)
		goto error;

	edac_debugfs_init();

	/* Setup/Initialize the workq for this core */
	err = edac_workqueue_setup();
	if (err) {
		edac_printk(KERN_ERR, EDAC_MC, "init WorkQueue failure\n");
		goto error;
	}

	return 0;

error:
	return err;
}
Beispiel #2
0
/*
 * edac_init
 *      module initialization entry point
 */
static int __init edac_init(void)
{
    int err = 0;

    edac_printk(KERN_INFO, EDAC_MC, EDAC_VERSION "\n");

    /*
     * Harvest and clear any boot/initialization PCI parity errors
     *
     * FIXME: This only clears errors logged by devices present at time of
     *      module initialization.  We should also do an initial clear
     *      of each newly hotplugged device.
     */
    edac_pci_clear_parity_errors();

    /*
     * perform the registration of the /sys/devices/system/edac class object
     */
    if (edac_register_sysfs_edac_name()) {
        edac_printk(KERN_ERR, EDAC_MC,
                    "Error initializing 'edac' kobject\n");
        err = -ENODEV;
        goto error;
    }

    /*
     * now set up the mc_kset under the edac class object
     */
    err = edac_sysfs_setup_mc_kset();
    if (err)
        goto sysfs_setup_fail;

    /* Setup/Initialize the workq for this core */
    err = edac_workqueue_setup();
    if (err) {
        edac_printk(KERN_ERR, EDAC_MC, "init WorkQueue failure\n");
        goto workq_fail;
    }

    return 0;

    /* Error teardown stack */
workq_fail:
    edac_sysfs_teardown_mc_kset();

sysfs_setup_fail:
    edac_unregister_sysfs_edac_name();

error:
    return err;
}