OSDN Git Service

tty: serial: samsung_tty: Separate S3C64XX ops structure
authorHector Martin <marcan@marcan.st>
Thu, 4 Mar 2021 21:38:53 +0000 (06:38 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Mar 2021 08:34:10 +0000 (09:34 +0100)
commit646891638301dad90e4dab9bc23e939575ad8012
treef57ee502f8a61488e7a2120bace46dadfd7cacd9
parent19d48787e31563b57f4f5549e926fbee46b394da
tty: serial: samsung_tty: Separate S3C64XX ops structure

Instead of patching a single global ops structure depending on the port
type, use a separate s3c64xx_serial_ops for the S3C64XX type. This
allows us to mark the structures as const.

Also split out s3c64xx_serial_shutdown into a separate function now that
we have a separate ops structure; this avoids excessive branching
control flow and mirrors s3c64xx_serial_startup. tx_claimed and
rx_claimed are only used in the S3C24XX functions.

Signed-off-by: Hector Martin <marcan@marcan.st>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Tested-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Link: https://lore.kernel.org/r/20210304213902.83903-19-marcan@marcan.st
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/samsung_tty.c