/* called when the device is closed. makes sure that the device flushes the internal cache before we close.  */
static void pkt_release_dev(struct pktcdvd_device *pd, int flush)
/* called when the device is closed. makes sure that the device flushes the internal cache before we close.  */
static void pkt_release_dev(struct pktcdvd_device *pd, int flush)
{
	if (flush && pkt_flush_cache(pd))
		DPRINTK(DRIVER_NAME": %s not flushing cache\n", pd->name);
	pkt_lock_door(pd, 0);
	pkt_set_speed(pd, MAX_SPEED, MAX_SPEED);
	bd_release(pd->bdev);
	blkdev_put(pd->bdev, FMODE_READ);
	pkt_shrink_pktlist(pd);
}