RE: [PATCH v4 1/5] i2c: nvidia-gpu: refactor master_xfer

2019-06-07 Thread Ajay Gupta
Hi Wolfram, > -Original Message- > From: Wolfram Sang > Sent: Friday, June 7, 2019 1:33 AM > To: Ajay Gupta > Cc: heikki.kroge...@linux.intel.com; linux-usb@vger.kernel.org; linux- > i...@vger.kernel.org; Ajay Gupta > Subject: Re: [PATCH v4 1/5] i2c: nvidia-gpu:

Re: [PATCH v4 1/5] i2c: nvidia-gpu: refactor master_xfer

2019-06-07 Thread Wolfram Sang
> Changes from v3->v4: > - Further refactor master_xfer based on Wolfram's comment. Yay, looks even better. One thing to improve, though. > status = gpu_i2c_stop(i2cd); send_stop = false; > - if (status < 0) > - return status; > + if (status < 0) { > +

[PATCH v4 1/5] i2c: nvidia-gpu: refactor master_xfer

2019-06-03 Thread Ajay Gupta
From: Ajay Gupta 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.