CHROMIUM: cros_ec_uart: Fix race condition

Currently serdev_device_set_client_ops is called before ec_dev is fully
initialized. This can result in cros_ec_uart_rx_bytes being called while
ec_dev is still not initialized, resulting in a kernel panic. This change
moves the call to serdev_device_set_client_ops to after ec_dev is
initialized.

cros_ec_uart has not been upstreamed yet, see b:177059987

BUG=b:186004696
TEST=Booted device multiple times, checking that the kernel panic in
cros_ec_uart_rx_bytes no longer happens

Change-Id: I450f7e1fc7535cdc3d53e999af61a91282364dbd
Signed-off-by: Robert Zieba <robertzieba@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/3488928
Reviewed-by: Raul Rangel <rrangel@chromium.org>
Reviewed-by: Rob Barnes <robbarnes@google.com>
1 file changed