/* Send a SYNCHRONIZE CACHE instruction down to the device through the normal SCSI command structure. Wait for the command to complete.  */
static void sd_shutdown(struct device *)
/* Send a SYNCHRONIZE CACHE instruction down to the device through the normal SCSI command structure. Wait for the command to complete.  */
static void sd_shutdown(struct device *)
{
	struct scsi_disk *sdkp = scsi_disk_get_from_dev(dev);
	if (!sdkp)
		return;
	if (sdkp->WCE) {
		sd_printk(KERN_NOTICE, sdkp, "Synchronizing SCSI cache\n");
		sd_sync_cache(sdkp);
	}
	if (system_state != SYSTEM_RESTART && sdkp->device->manage_start_stop) {
		sd_printk(KERN_NOTICE, sdkp, "Stopping disk\n");
		sd_start_stop_device(sdkp, 0);
	}
	scsi_disk_put(sdkp);
}