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

Commit dcb57a63 authored by Mukesh Kumar Savaliya's avatar Mukesh Kumar Savaliya Committed by Gerrit - the friendly Code Review server
Browse files

serial: msm_geni_serial: Reduce nos tty port registration



UART geni driver supports max 1 console port only whereas it uses
HSUART defined macro. This will just create more tty port as part
of registration which is not required. Hence change console port
registration to 1 port.

Change-Id: I1535f7ea92fe3ddf861cc24c82bd0d4c54408d73
Signed-off-by: default avatarMukesh Kumar Savaliya <msavaliy@codeaurora.org>
parent eac6c82e
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -479,6 +479,7 @@ static struct msm_geni_serial_port *get_port_from_line(int line,
	struct msm_geni_serial_port *port = NULL;

	if (is_console) {
		/* Max 1 port supported as of now */
		if ((line < 0) || (line >= GENI_UART_CONS_PORTS))
			return ERR_PTR(-ENXIO);
		port = &msm_geni_console_port;
@@ -774,7 +775,8 @@ static void msm_geni_serial_console_write(struct console *co, const char *s,
	int locked = 1;
	unsigned long flags;

	WARN_ON(co->index < 0 || co->index >= GENI_UART_NR_PORTS);
	/* Max 1 port supported as of now */
	WARN_ON(co->index < 0 || co->index >= GENI_UART_CONS_PORTS);

	port = get_port_from_line(co->index, true);
	if (IS_ERR_OR_NULL(port))
@@ -2086,7 +2088,8 @@ static int __init msm_geni_console_setup(struct console *co, char *options)
	int flow = 'n';
	int ret = 0;

	if (unlikely(co->index >= GENI_UART_NR_PORTS  || co->index < 0))
	/* Max 1 port supported as of now */
	if (unlikely(co->index >= GENI_UART_CONS_PORTS  || co->index < 0))
		return -ENXIO;

	dev_port = get_port_from_line(co->index, true);
@@ -2252,7 +2255,7 @@ static struct uart_driver msm_geni_console_driver = {
	.owner = THIS_MODULE,
	.driver_name = "msm_geni_console",
	.dev_name = "ttyMSM",
	.nr =  GENI_UART_NR_PORTS,
	.nr =  GENI_UART_CONS_PORTS,
	.cons = &cons_ops,
};
#else