i2c: nvidia-gpu: refactor master_xfer
authorAjay Gupta <ajayg@nvidia.com>
Fri, 7 Jun 2019 16:34:19 +0000 (09:34 -0700)
committerWolfram Sang <wsa@the-dreams.de>
Fri, 7 Jun 2019 22:09:08 +0000 (00:09 +0200)
commitcb7302fbe365cd079b7481720daf04e5e1925ac0
tree11d07c814ae6a5c07ad000ebaf4613e6db960dbb
parent5213d7efc8ec26ed8938dce75427eff9275a62d9
i2c: nvidia-gpu: refactor master_xfer

Added a local variable "send_stop" to simplify "goto" statements.

The "send_stop" handles below two case
1) When first i2c start fails and so i2c stop is not sent before
exiting

2) When i2c stop failed after all transfers and we do not need to
send another stop before exiting.

Signed-off-by: Ajay Gupta <ajayg@nvidia.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/busses/i2c-nvidia-gpu.c