Beispiel #1
0
/**
 * aer_probe - initialize resources
 * @dev: pointer to the pcie_dev data structure
 * @id: pointer to the service id data structure
 *
 * Invoked when PCI Express bus loads AER service driver.
 **/
static int __devinit aer_probe(struct pcie_device *dev)
{
	int status;
	struct aer_rpc *rpc;
	struct device *device = &dev->device;

	/* Init */
	status = aer_init(dev);
	if (status)
		return status;

	/* Alloc rpc data structure */
	rpc = aer_alloc_rpc(dev);
	if (!rpc) {
		dev_printk(KERN_DEBUG, device, "alloc rpc failed\n");
		aer_remove(dev);
		return -ENOMEM;
	}

	/* Request IRQ ISR */
	status = request_irq(dev->irq, aer_irq, IRQF_SHARED, "aerdrv", dev);
	if (status) {
		dev_printk(KERN_DEBUG, device, "request IRQ failed\n");
		aer_remove(dev);
		return status;
	}

	rpc->isr = 1;

	aer_enable_rootport(rpc);

	return status;
}
Beispiel #2
0
/**
 * aer_probe - initialize resources
 * @dev: pointer to the pcie_dev data structure
 * @id: pointer to the service id data structure
 *
 * Invoked when PCI Express bus loads AER service driver.
 **/
static int __devinit aer_probe (struct pcie_device *dev,
                const struct pcie_port_service_id *id )
{
    int status;
    struct aer_rpc *rpc;
    struct device *device = &dev->device;

    /* Init */
    if ((status = aer_init(dev)))
        return status;

    /* Alloc rpc data structure */
    if (!(rpc = aer_alloc_rpc(dev))) {
        printk(KERN_DEBUG "%s: Alloc rpc fails on PCIE device[%s]\n",
            __func__, device->bus_id);
        aer_remove(dev);
        return -ENOMEM;
    }

    /* Request IRQ ISR */
    if ((status = request_irq(dev->irq, aer_irq, IRQF_SHARED, "aerdrv",
                dev))) {
        printk(KERN_DEBUG "%s: Request ISR fails on PCIE device[%s]\n",
            __func__, device->bus_id);
        aer_remove(dev);
        return status;
    }

    rpc->isr = 1;

    aer_enable_rootport(rpc);

    return status;
}