/* Adds a doorbell resource/callback pair into a port's doorbell event list. Returns 0 if the request has been satisfied.  */
static int rio_setup_inb_dbell(struct rio_mport *mport, void *dev_id, struct resource *res, void(*dinb)(struct rio_mport *mport, void *dev_id, u16 src, u16 dst, u16 info))
/* Adds a doorbell resource/callback pair into a port's doorbell event list. Returns 0 if the request has been satisfied.  */
static int rio_setup_inb_dbell(struct rio_mport *mport, void *dev_id, struct resource *res, void(*dinb)(struct rio_mport *mport, void *dev_id, u16 src, u16 dst, u16 info))
{
	int rc = 0;
	struct rio_dbell *dbell;
	if (!(dbell = kmalloc(sizeof(struct rio_dbell), GFP_KERNEL))) {
		rc = -ENOMEM;
		goto out;
	}
	dbell->res = res;
	dbell->dinb = dinb;
	dbell->dev_id = dev_id;
	list_add_tail(&dbell->node, &mport->dbells);
      out:
	return rc;
}