rem: &count, 0);
add: &count, DDI_INTR_ALLOC_NORMAL);
context: pepb_intr_init(pepb_devstate_t *pepb_p, int intr_type){	dev_info_t	*dip = pepb_p->dip;	int		request = 1, count, x;	int		ret;	int		intr_cap = 0;	PEPB_DEBUG((CE_NOTE, "pepb_intr_init: Attaching %s handler\n",	    (intr_type == DDI_INTR_TYPE_MSI) ? "MSI" : "INTx"));	/*	 * Get number of requested interrupts.	If none requested or DDI_FAILURE	 * just return DDI_SUCCESS.	 *	 * Several Bridges/Switches will not have this property set, resulting	 * in a FAILURE, if the device is not configured in a way that	 * interrupts are needed. (eg. hotplugging)	 */	ret = ddi_intr_get_nintrs(dip, intr_type, &request);	if ((ret != DDI_SUCCESS) || (request == 0)) {		PEPB_DEBUG((CE_NOTE, "ddi_intr_get_nintrs ret:%d req:%d\n",		    ret, request));		return (DDI_FAILURE);	}	/* Allocate an array of interrupt handlers */	pepb_p->htable_size = sizeof (ddi_intr_handle_t) * request;	pepb_p->htable = kmem_zalloc(pepb_p->htable_size, KM_SLEEP);	pepb_p->soft_state |= PEPB_SOFT_STATE_INIT_HTABLE;	ret = ddi_intr_alloc(dip, pepb_p->htable, intr_type, 0, request,	    &count, 0);	if ((ret != DDI_SUCCESS) || (count == 0)) {		PEPB_DEBUG((CE_NOTE, "ddi_intr_alloc() ret: %d ask: %d"		    " actual: %d\n", ret, request, count));		goto fail;	}	/* Save the actual number of interrupts allocated */	pepb_p->intr_count = count;#ifdef	DEBUG	if (count < request)		PEPB_DEBUG((CE_WARN, "Requested Intr: %d Received: %d\n",		    request, count));#endif	/* DEBUG */	pepb_p->soft_state |= PEPB_SOFT_STATE_INIT_ALLOC;	/* Get interrupt priority */	ret = ddi_intr_get_pri(pepb_p->htable[0], &pepb_p->intr_priority);	if (ret != DDI_SUCCESS) {		PEPB_DEBUG((CE_WARN, "ddi_intr_get_pri() ret: %d\n", ret));		goto fail;	}	/* initialize the interrupt mutex */	mutex_init(&pepb_p->pepb_mutex, NULL, MUTEX_DRIVER,	    DDI_INTR_PRI(PEPB_INTR_PRI));	pepb_p->soft_state |= PEPB_SOFT_STATE_INIT_MUTEX;	for (count = 0; count < pepb_p->intr_count; count++) {		ret = ddi_intr_add_handler(pepb_p->htable[count],		    pepb_intr, (caddr_t)pepb_p, NULL);		if (ret != DDI_SUCCESS) {			PEPB_DEBUG((CE_WARN, "Cannot add interrupt(%d)\n",			    ret));			break;		}	}	/* If unsucessful, remove the added handlers */	if (ret != DDI_SUCCESS) {		for (x = 0; x < count; x++) {			(void) ddi_intr_remove_handler(pepb_p->htable[x]);		}		goto fail;	}	pepb_p->soft_state |= PEPB_SOFT_STATE_INIT_HANDLER;	(void) ddi_intr_get_cap(pepb_p->htable[0], &intr_cap);	if (intr_cap & DDI_INTR_FLAG_BLOCK) {		(void) ddi_intr_block_enable(pepb_p->htable,		    pepb_p->intr_count);		pepb_p->soft_state |= PEPB_SOFT_STATE_INIT_BLOCK;	} else {		for (count = 0; count < pepb_p->intr_count; count++) {			(void) ddi_intr_enable(pepb_p->htable[count]);		}	}	pepb_p->soft_state |= PEPB_SOFT_STATE_INIT_ENABLE;	/* Save the interrupt type */	pepb_p->intr_type = intr_type;	return (DDI_SUCCESS);fail:	pepb_intr_fini(pepb_p);	return (DDI_FAILURE);}