[PATCH 5/6] staging: sm750fb: sw_i2c_write_byte: return -EIO on failure
From: Soham Kute
Date: Wed Mar 04 2026 - 12:36:57 EST
Return -EIO instead of -1 when the I2C byte write fails.
The caller ignores the return value.
Signed-off-by: Soham Kute <officialsohamkute@xxxxxxxxx>
---
drivers/staging/sm750fb/ddk750_swi2c.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/sm750fb/ddk750_swi2c.c b/drivers/staging/sm750fb/ddk750_swi2c.c
index 0ef8d4ff2ef9..c73943341f66 100644
--- a/drivers/staging/sm750fb/ddk750_swi2c.c
+++ b/drivers/staging/sm750fb/ddk750_swi2c.c
@@ -239,7 +239,7 @@ static void sw_i2c_stop(void)
*
* Return Value:
* 0 - Success
- * -1 - Fail to write byte
+ * -EIO - Fail to write byte
*/
static long sw_i2c_write_byte(unsigned char data)
{
@@ -294,7 +294,7 @@ static long sw_i2c_write_byte(unsigned char data)
if (i < 0xff)
return 0;
else
- return -1;
+ return -EIO;
}
/*
--
2.34.1