/* hvc_instantiate() is an early console discovery method which locates consoles * prior to the vio subsystem discovering them. Hotplugged vty adapters do NOT get an hvc_instantiate() callback since they appear after early console init.  */
int hvc_instantiate(uint32_t vtermno, int index, struct hv_ops *ops)
/* hvc_instantiate() is an early console discovery method which locates consoles * prior to the vio subsystem discovering them. Hotplugged vty adapters do NOT get an hvc_instantiate() callback since they appear after early console init.  */
int hvc_instantiate(uint32_t vtermno, int index, struct hv_ops *ops)
{
	struct hvc_struct *hp;
	if (index < 0 || index >= MAX_NR_HVC_CONSOLES)
		return -1;
	if (vtermnos[index] != -1)
		return -1;
	hp = hvc_get_by_index(index);
	if (hp) {
		kref_put(&hp->kref, destroy_hvc_struct);
		return -1;
	}
	vtermnos[index] = vtermno;
	cons_ops[index] = ops;
	if (last_hvc < index)
		last_hvc = index;
	if (index == hvc_con_driver.index)
		register_console(&hvc_con_driver);
	return 0;
}