linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] i2c: gxp: return proper error on address NACK
@ 2023-02-20 14:40 Wolfram Sang
  2023-03-03 20:00 ` Wolfram Sang
  0 siblings, 1 reply; 2+ messages in thread
From: Wolfram Sang @ 2023-02-20 14:40 UTC (permalink / raw)
  To: linux-i2c; +Cc: nick.hawkins, Wolfram Sang

According to Documentation/i2c/fault-codes.rst, NACK after sending an
address should be -ENXIO.

Signed-off-by: Wolfram Sang <wsa@kernel.org>
---

Depends on: "[PATCH] i2c: gxp: remove "empty" switch statement"

 drivers/i2c/busses/i2c-gxp.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-gxp.c b/drivers/i2c/busses/i2c-gxp.c
index 352dedf6292f..fda7809e72ba 100644
--- a/drivers/i2c/busses/i2c-gxp.c
+++ b/drivers/i2c/busses/i2c-gxp.c
@@ -129,8 +129,10 @@ static int gxp_i2c_master_xfer(struct i2c_adapter *adapter,
 	if (time_left == 0)
 		return -ETIMEDOUT;
 
-	if (drvdata->state == GXP_I2C_ADDR_NACK ||
-	    drvdata->state == GXP_I2C_DATA_NACK)
+	if (drvdata->state == GXP_I2C_ADDR_NACK)
+		return -ENXIO;
+
+	if (drvdata->state == GXP_I2C_DATA_NACK)
 		return -EIO;
 
 	return ret;
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] i2c: gxp: return proper error on address NACK
  2023-02-20 14:40 [PATCH] i2c: gxp: return proper error on address NACK Wolfram Sang
@ 2023-03-03 20:00 ` Wolfram Sang
  0 siblings, 0 replies; 2+ messages in thread
From: Wolfram Sang @ 2023-03-03 20:00 UTC (permalink / raw)
  To: linux-i2c; +Cc: nick.hawkins

[-- Attachment #1: Type: text/plain, Size: 254 bytes --]

On Mon, Feb 20, 2023 at 03:40:59PM +0100, Wolfram Sang wrote:
> According to Documentation/i2c/fault-codes.rst, NACK after sending an
> address should be -ENXIO.
> 
> Signed-off-by: Wolfram Sang <wsa@kernel.org>

Applied to for-current, thanks!


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-03-03 20:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-20 14:40 [PATCH] i2c: gxp: return proper error on address NACK Wolfram Sang
2023-03-03 20:00 ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).