Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fd01a7a1 authored by Timur Tabi's avatar Timur Tabi Committed by Greg Kroah-Hartman
Browse files

drivers/tty: don't use the byte channel handle as a parameter in ehv_bytechan.c



The ePAPR hypervisor byte channel console driver only supports one byte
channel as a console, and the byte channel handle is stored in a global
variable.  It doesn't make any sense to pass that handle as a parameter
to the console functions, since these functions already have access to the
global variable.

Signed-off-by: default avatarTimur Tabi <timur@freescale.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 9cfb5c05
Loading
Loading
Loading
Loading
+2 −5
Original line number Original line Diff line number Diff line
@@ -282,7 +282,6 @@ static int ehv_bc_console_byte_channel_send(unsigned int handle, const char *s,
static void ehv_bc_console_write(struct console *co, const char *s,
static void ehv_bc_console_write(struct console *co, const char *s,
				 unsigned int count)
				 unsigned int count)
{
{
	unsigned int handle = (uintptr_t)co->data;
	char s2[EV_BYTE_CHANNEL_MAX_BYTES];
	char s2[EV_BYTE_CHANNEL_MAX_BYTES];
	unsigned int i, j = 0;
	unsigned int i, j = 0;
	char c;
	char c;
@@ -295,14 +294,14 @@ static void ehv_bc_console_write(struct console *co, const char *s,


		s2[j++] = c;
		s2[j++] = c;
		if (j >= (EV_BYTE_CHANNEL_MAX_BYTES - 1)) {
		if (j >= (EV_BYTE_CHANNEL_MAX_BYTES - 1)) {
			if (ehv_bc_console_byte_channel_send(handle, s2, j))
			if (ehv_bc_console_byte_channel_send(stdout_bc, s2, j))
				return;
				return;
			j = 0;
			j = 0;
		}
		}
	}
	}


	if (j)
	if (j)
		ehv_bc_console_byte_channel_send(handle, s2, j);
		ehv_bc_console_byte_channel_send(stdout_bc, s2, j);
}
}


/*
/*
@@ -348,8 +347,6 @@ static int __init ehv_bc_console_init(void)
			   CONFIG_PPC_EARLY_DEBUG_EHV_BC_HANDLE);
			   CONFIG_PPC_EARLY_DEBUG_EHV_BC_HANDLE);
#endif
#endif


	ehv_bc_console.data = (void *)(uintptr_t)stdout_bc;

	/* add_preferred_console() must be called before register_console(),
	/* add_preferred_console() must be called before register_console(),
	   otherwise it won't work.  However, we don't want to enumerate all the
	   otherwise it won't work.  However, we don't want to enumerate all the
	   byte channels here, either, since we only care about one. */
	   byte channels here, either, since we only care about one. */