OSDN Git Service

serial: sunhv: Initialize lock for non-registered console
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 2 Apr 2020 17:20:26 +0000 (20:20 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 16 Apr 2020 14:16:52 +0000 (16:16 +0200)
commit0f87aa66e8c314f95c00eeff978c8a0b41e05d50
tree490c728a55e16b8f1ecda764c065cdf650c0f148
parent18cc7ac8a28e28cd005c2475f52576cfe10cabfb
serial: sunhv: Initialize lock for non-registered console

The commit a3cb39d258ef
("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 Sparc HV 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: a3cb39d258ef ("serial: core: Allow detach and attach serial device for console")
Reported-by: Anatoly Pugachev <matorola@gmail.com>
Cc: David Miller <davem@davemloft.net>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Anatoly Pugachev <matorola@gmail.com>
Link: https://lore.kernel.org/r/20200402172026.79478-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/sunhv.c