提交 8f065ace 编写于 作者: A Andy Shevchenko 提交者: Greg Kroah-Hartman

serial: imx: Initialize lock for non-registered console

The commit a3cb39d2
("serial: core: Allow detach and attach serial device for console")
changed a bit logic behind lock initialization since for most of the console
driver it's supposed to have lock already initialized even if console is not
enabled. However, it's not the case for Freescale IMX console.

Initialize lock explicitly in the ->probe().

Note, there is still an open question should or shouldn't not this driver
register console properly.

Fixes: a3cb39d2 ("serial: core: Allow detach and attach serial device for console")
Reported-by: NGuenter Roeck <linux@roeck-us.net>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20200525105952.13744-1-andriy.shevchenko@linux.intel.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 344235f5
......@@ -2404,6 +2404,9 @@ static int imx_uart_probe(struct platform_device *pdev)
}
}
/* We need to initialize lock even for non-registered console */
spin_lock_init(&sport->port.lock);
imx_uart_ports[sport->port.line] = sport;
platform_set_drvdata(pdev, sport);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册