diff mbox series

[1/4] i2c-xiic: return value of xiic_reinit

Message ID 20220420075924.14546-2-shubhrajyoti.datta@xilinx.com
State Accepted
Commit 8fa9c93880530a91c6ea83b49bd37c268e9bf47e
Headers show
Series i2c: xiic: misc fixes | expand

Commit Message

Shubhrajyoti Datta April 20, 2022, 7:59 a.m. UTC
Check the return value of xiic_reinit.

Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
---
 drivers/i2c/busses/i2c-xiic.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Michal Simek April 21, 2022, 8:46 a.m. UTC | #1
On 4/20/22 09:59, Shubhrajyoti Datta wrote:
> Check the return value of xiic_reinit.
> 
> Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
> ---
>   drivers/i2c/busses/i2c-xiic.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c
> index ffefe3c482e9..8b39f9c7e773 100644
> --- a/drivers/i2c/busses/i2c-xiic.c
> +++ b/drivers/i2c/busses/i2c-xiic.c
> @@ -381,6 +381,7 @@ static irqreturn_t xiic_process(int irq, void *dev_id)
>   	int xfer_more = 0;
>   	int wakeup_req = 0;
>   	int wakeup_code = 0;
> +	int ret;
>   
>   	/* Get the interrupt Status from the IPIF. There is no clearing of
>   	 * interrupts in the IPIF. Interrupts must be cleared at the source.
> @@ -415,7 +416,9 @@ static irqreturn_t xiic_process(int irq, void *dev_id)
>   		 * fifos and the next message is a TX with len 0 (only addr)
>   		 * reset the IP instead of just flush fifos
>   		 */
> -		xiic_reinit(i2c);
> +		ret = xiic_reinit(i2c);
> +		if (!ret)
> +			dev_dbg(i2c->adap.dev.parent, "reinit failed\n");
>   
>   		if (i2c->rx_msg) {
>   			wakeup_req = 1;

Acked-by: Michal Simek <michal.simek@xilinx.com>

Thanks,
Michal
Wolfram Sang May 14, 2022, 2:03 p.m. UTC | #2
On Wed, Apr 20, 2022 at 01:29:21PM +0530, Shubhrajyoti Datta wrote:
> Check the return value of xiic_reinit.
> 
> Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>

Applied to for-next, thanks!
diff mbox series

Patch

diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c
index ffefe3c482e9..8b39f9c7e773 100644
--- a/drivers/i2c/busses/i2c-xiic.c
+++ b/drivers/i2c/busses/i2c-xiic.c
@@ -381,6 +381,7 @@  static irqreturn_t xiic_process(int irq, void *dev_id)
 	int xfer_more = 0;
 	int wakeup_req = 0;
 	int wakeup_code = 0;
+	int ret;
 
 	/* Get the interrupt Status from the IPIF. There is no clearing of
 	 * interrupts in the IPIF. Interrupts must be cleared at the source.
@@ -415,7 +416,9 @@  static irqreturn_t xiic_process(int irq, void *dev_id)
 		 * fifos and the next message is a TX with len 0 (only addr)
 		 * reset the IP instead of just flush fifos
 		 */
-		xiic_reinit(i2c);
+		ret = xiic_reinit(i2c);
+		if (!ret)
+			dev_dbg(i2c->adap.dev.parent, "reinit failed\n");
 
 		if (i2c->rx_msg) {
 			wakeup_req = 1;