/* Set the target state for a device and starts the state change.  */
void dasd_set_target_state(struct dasd_device *device, int target)
/* Set the target state for a device and starts the state change.  */
void dasd_set_target_state(struct dasd_device *device, int target)
{
	dasd_get_device(device);
	if (dasd_probeonly && target > DASD_STATE_READY)
		target = DASD_STATE_READY;
	if (device->target != target) {
		if (device->state == target) {
			wake_up(&dasd_init_waitq);
			dasd_put_device(device);
		}
		device->target = target;
	}
	if (device->state != device->target)
		dasd_change_state(device);
}