Skip to contentSkip to conversation

drm/bridge: anx7625: Fix edid_read break case in sp_tx_edid_read()

PATCH Applied Hsin-Yi Wang 3 participants 3 messages Nov 18, 2021 – Nov 24, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 drm/bridge: anx7625: Fix edid_read break case in sp_tx_edid_read()

edid_read() was assumed to return 0 on success. After 7f16d0f3b8e2("drm/bridge: anx7625: Propagate errors from sp_tx_rst_aux()"), the function will return > 0 for successful case, representing the i2c read bytes. Otherwise -EIO on failure cases. Update the g_edid_break break condition accordingly.

Fixes 7f16d0f3b8e2("drm/bridge: anx7625: Propagate errors from sp_tx_rst_aux()")

---
v2: Fix type error.

---
 drivers/gpu/drm/bridge/analogix/anx7625.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/bridge/analogix/anx7625.c +2 -2
index 1a871f6b6822ee..3a18f1dabcfd51 100644
@@ -795,7 +795,7 @@ static int sp_tx_edid_read(struct anx7625_data *ctx,
 	int count, blocks_num;
 	u8 pblock_buf[MAX_DPCD_BUFFER_SIZE];
 	u8 i, j;
-	u8 g_edid_break = 0;
+	int g_edid_break = 0;
 	int ret;
 	struct device *dev = &ctx->client->dev;
 
@@ -826,7 +826,7 @@ static int sp_tx_edid_read(struct anx7625_data *ctx,
 				g_edid_break = edid_read(ctx, offset,
 							 pblock_buf);
 
-				if (g_edid_break)
+				if (g_edid_break < 0)
 					break;
 
 				memcpy(&pedid_blocks_buf[offset],
Signature · 1 line
2.34.0.rc2.393.gf8c9666880-goog
Reviewed-by on v2 1/1
#1 lore raw
Quoted 5 lines · Hsin-Yi Wang

edid_read() was assumed to return 0 on success. After 7f16d0f3b8e2("drm/bridge: anx7625: Propagate errors from sp_tx_rst_aux()"), the function will return > 0 for successful case, representing the i2c read bytes. Otherwise -EIO on failure cases. Update the g_edid_break break condition accordingly.

Hi Hsin-Yi, thanks for the patch!

Quoted 34 lines
Fixes 7f16d0f3b8e2("drm/bridge: anx7625: Propagate errors from sp_tx_rst_aux()")

---
v2: Fix type error.

---
 drivers/gpu/drm/bridge/analogix/anx7625.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/bridge/analogix/anx7625.c +2 -2
index 1a871f6b6822ee..3a18f1dabcfd51 100644
@@ -795,7 +795,7 @@ static int sp_tx_edid_read(struct anx7625_data *ctx,
 	int count, blocks_num;
 	u8 pblock_buf[MAX_DPCD_BUFFER_SIZE];
 	u8 i, j;
-	u8 g_edid_break = 0;
+	int g_edid_break = 0;
 	int ret;
 	struct device *dev = &ctx->client->dev;
 
@@ -826,7 +826,7 @@ static int sp_tx_edid_read(struct anx7625_data *ctx,
 				g_edid_break = edid_read(ctx, offset,
 							 pblock_buf);
 
-				if (g_edid_break)
+				if (g_edid_break < 0)
 					break;
 
 				memcpy(&pedid_blocks_buf[offset],
Signature · 1 line
2.34.0.rc2.393.gf8c9666880-goog
Applied
#2 lore raw
Quoted 36 lines · Xin Ji
Quoted 5 lines · Hsin-Yi Wang

edid_read() was assumed to return 0 on success. After 7f16d0f3b8e2("drm/bridge: anx7625: Propagate errors from sp_tx_rst_aux()"), the function will return > 0 for successful case, representing the i2c read bytes. Otherwise -EIO on failure cases. Update the g_edid_break break condition accordingly.

Hi Hsin-Yi, thanks for the patch!

Quoted 27 lines
Fixes 7f16d0f3b8e2("drm/bridge: anx7625: Propagate errors from sp_tx_rst_aux()")

---
v2: Fix type error.

---
 drivers/gpu/drm/bridge/analogix/anx7625.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/bridge/analogix/anx7625.c +1 -1
index 1a871f6b6822ee..3a18f1dabcfd51 100644
@@ -795,7 +795,7 @@ static int sp_tx_edid_read(struct anx7625_data *ctx,
      int count, blocks_num;
      u8 pblock_buf[MAX_DPCD_BUFFER_SIZE];
      u8 i, j;
-     u8 g_edid_break = 0;
+     int g_edid_break = 0;
      int ret;
      struct device *dev = &ctx->client->dev;
 
@@ -826,7 +826,7 @@ static int sp_tx_edid_read(struct anx7625_data *ctx,
                              g_edid_break = edid_read(ctx, offset,
                                                       pblock_buf);
 
Quoted 6 lines

drivers/gpu/drm/bridge/analogix/anx7625.c static int sp_tx_edid_read(struct anx7625_data *ctx,

Quoted 6 lines
drivers/gpu/drm/bridge/analogix/anx7625.c +1 -2
-                             if (g_edid_break)
+                             if (g_edid_break < 0)
                                      break;
 
                              memcpy(&pedid_blocks_buf[offset],
--

Fixed commit id syntax of commit message in order to make checkpatch --strict happy.

Applied to drm-misc-next.