/* Releases ownership of an inbound doorbell resource and removes callback from the doorbell event list. Returns 0 if the request has been satisfied.  */
int rio_release_inb_dbell(struct rio_mport *mport, u16 start, u16 end)
/* Releases ownership of an inbound doorbell resource and removes callback from the doorbell event list. Returns 0 if the request has been satisfied.  */
int rio_release_inb_dbell(struct rio_mport *mport, u16 start, u16 end)
{
	int rc = 0, found = 0;
	struct rio_dbell *dbell;
	list_for_each_entry(dbell, &mport->dbells, node) {
		if ((dbell->res->start == start) && (dbell->res->end == end)) {
			found = 1;
			break;
		}
	}
	if (!found) {
		rc = -EINVAL;
		goto out;
	}
	list_del(&dbell->node);
	rc = release_resource(dbell->res);
	kfree(dbell);
      out:
	return rc;
}