FreeBSD/sys/dev/xen/pcifront/pcifront.c
/* Release a reference to a pcifront device */
Release a reference to a pcifront device
Release a reference to a pcifront device
static void
put_pdev(struct pcifront_device *pdev)
{
	if (--pdev->ref_cnt > 0)
		return;
	DPRINTF("freeing pdev @ 0x%p (ref_cnt=%d)\n", pdev, pdev->ref_cnt);
	if (pdev->evtchn != INVALID_EVTCHN)
		xenbus_free_evtchn(pdev->xdev, pdev->evtchn);
	if (pdev->gnt_ref != INVALID_GRANT_REF)
		gnttab_end_foreign_access(pdev->gnt_ref, 0, (void *)pdev->sh_info);
	pdev->xdev->data = NULL;
	free(pdev, M_DEVBUF);
}
static void put_pdev ( struct pcifront_device * pdev ) { if ( -- pdev -> ref_cnt > 0 ) return ; DPRINTF ( " \n " , pdev , pdev -> ref_cnt ) ; if ( pdev -> evtchn != INVALID_EVTCHN ) xenbus_free_evtchn ( pdev -> xdev , pdev -> evtchn ) ; if ( pdev -> gnt_ref != INVALID_GRANT_REF ) gnttab_end_foreign_access ( pdev -> gnt_ref , 0 , ( void * ) pdev -> sh_info ) ; pdev -> xdev -> data = NULL ; free ( pdev , M_DEVBUF ) ; }
Release a reference to a pcifront device
Release a reference to a pcifront device