platform/chrome: cros_ec_proto: factor legacy out from cros_ec_prepare_tx()
authorTzung-Bi Shih <tzungbi@kernel.org>
Wed, 18 May 2022 09:18:12 +0000 (17:18 +0800)
committerTzung-Bi Shih <tzungbi@kernel.org>
Mon, 6 Jun 2022 03:11:37 +0000 (03:11 +0000)
commit23a34e3a9d00829f6bed67004a751d5b48f6084a
tree8145959b47571b6e9bb40e4991e724609a9b03cd
parentdb681eaf7145158fb49eddbdb548692e8bfe7fab
platform/chrome: cros_ec_proto: factor legacy out from cros_ec_prepare_tx()

cros_ec_prepare_tx() mixed the code for both versions.  To be neat and to
make it clear, factor the legacy part out as a separate function, rename
the function, and update the comments.

Specifically,
- prepare_tx(), for current protocol version (i.e. 3).
- prepare_tx_legacy(), for protocol version <= 2.

Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
Link: https://lore.kernel.org/r/20220518091814.2028579-3-tzungbi@kernel.org
drivers/platform/chrome/cros_ec_proto.c