/* Make the device online and schedule the bottom half to start the requeueing of requests from the linux request queue to the ccw queue.  */
static int dasd_state_ready_to_online(struct dasd_device *device)
/* Make the device online and schedule the bottom half to start the requeueing of requests from the linux request queue to the ccw queue.  */
static int dasd_state_ready_to_online(struct dasd_device *device)
{
	int rc;
	struct gendisk *disk;
	struct disk_part_iter piter;
	struct hd_struct *part;
	if (device->discipline->ready_to_online) {
		rc = device->discipline->ready_to_online(device);
		if (rc)
			return rc;
	}
	device->state = DASD_STATE_ONLINE;
	if (device->block) {
		dasd_schedule_block_bh(device->block);
		disk = device->block->bdev->bd_disk;
		disk_part_iter_init(&piter, disk, DISK_PITER_INCL_PART0);
		while ((part = disk_part_iter_next(&piter)))
			kobject_uevent(&part_to_dev(part)->kobj, KOBJ_CHANGE);
		disk_part_iter_exit(&piter);
	}
	return 0;
}