/* Invoked when Root Port's AER service is loaded.  */
static struct aer_rpc* aer_alloc_rpc(struct pcie_device *dev)
/* Invoked when Root Port's AER service is loaded.  */
static struct aer_rpc* aer_alloc_rpc(struct pcie_device *dev)
{
	struct aer_rpc *rpc;
	rpc = kzalloc(sizeof(struct aer_rpc), GFP_KERNEL);
	if (!rpc)
		return NULL;
	spin_lock_init(&rpc->e_lock);
	rpc->rpd = dev;
	INIT_WORK(&rpc->dpc_handler, aer_isr);
	rpc->prod_idx = rpc->cons_idx = 0;
	mutex_init(&rpc->rpc_mutex);
	init_waitqueue_head(&rpc->wait_release);
	set_service_data(dev, rpc);
	return rpc;
}