/* cio_disable_subchannel - disable a subchannel. @sch: subchannel to disable  */
int cio_disable_subchannel(struct subchannel *sch)
/* cio_disable_subchannel - disable a subchannel. @sch: subchannel to disable  */
int cio_disable_subchannel(struct subchannel *sch)
{
	int retry;
	int ret;
	CIO_TRACE_EVENT(2, "dissch");
	CIO_TRACE_EVENT(2, dev_name(&sch->dev));
	if (sch_is_pseudo_sch(sch))
		return 0;
	if (cio_update_schib(sch))
		return -ENODEV;
	sch->config.ena = 0;
	for (retry = 0; retry < 3; retry++) {
		ret = cio_commit_config(sch);
		if (ret == -EBUSY) {
			struct irb irb;
			if (tsch(sch->schid, &irb) != 0)
				break;
		} else
			break;
	}
	CIO_HEX_EVENT(2, &ret, sizeof(ret));
	return ret;
}