[PATCH 2/7] drm/bridge: lt9211: fix regmap_write error handling

Philipp Zabel <[email protected]>
Newsgroups org.freedesktop.lists.dri-devel,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
Do not try to accumulate error return values with bitwise OR.

Fixes the remaining issue flagged by sashiko as low priority [1].

[1] https://sashiko.dev/#/patchset/20260719-add-lt9211c-bridge-v6-0-e56d22152586%40oss.qualcomm.com

Signed-off-by: Philipp Zabel <[email protected]>
---
 drivers/gpu/drm/bridge/lontium-lt9211.c | 25 +++++++++++++++----------
 1 file changed, 15 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/bridge/lontium-lt9211.c b/drivers/gpu/drm/bridge/lontium-lt9211.c
index 1b5cb601adde..bf72d1bcdb48 100644
--- a/drivers/gpu/drm/bridge/lontium-lt9211.c
+++ b/drivers/gpu/drm/bridge/lontium-lt9211.c
@@ -755,6 +755,7 @@ static int lt9211c_configure_plls(struct lt9211 *ctx,
 	};
 
 	unsigned int pval;
+	unsigned int val;
 	int ret;
 	u8 div;
 	u32 pcr_m;
@@ -774,7 +775,9 @@ static int lt9211c_configure_plls(struct lt9211 *ctx,
 
 	if (mode->clock < 22000) {
 		ret = regmap_write(ctx->regmap, 0x822f, 0x07);
-		ret |= regmap_write(ctx->regmap, 0x822c, 0x01);
+		if (ret)
+			return ret;
+		ret = regmap_write(ctx->regmap, 0x822c, 0x01);
 		div = 16;
 	} else if (mode->clock < 44000) {
 		ret = regmap_write(ctx->regmap, 0x822f, 0x07);
@@ -844,15 +847,17 @@ static int lt9211c_configure_plls(struct lt9211 *ctx,
 	if (ret)
 		return ret;
 
-	if (mode->clock < 44000) {
-		ret = regmap_write(ctx->regmap, 0xd00c, 0x60);
-		ret |= regmap_write(ctx->regmap, 0xd01b, 0x00);
-		ret |= regmap_write(ctx->regmap, 0xd01c, 0x60);
-	} else {
-		ret = regmap_write(ctx->regmap, 0xd00c, 0x40);
-		ret |= regmap_write(ctx->regmap, 0xd01b, 0x00);
-		ret |= regmap_write(ctx->regmap, 0xd01c, 0x40);
-	}
+	if (mode->clock < 44000)
+		val = 0x60;
+	else
+		val = 0x40;
+	ret = regmap_write(ctx->regmap, 0xd00c, val);
+	if (ret)
+		return ret;
+	ret = regmap_write(ctx->regmap, 0xd01b, 0x00);
+	if (ret)
+		return ret;
+	ret = regmap_write(ctx->regmap, 0xd01c, val);
 	if (ret)
 		return ret;
 
-- 
2.47.3
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.