From patchwork Thu Nov 18 19:30:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hsin-Yi Wang X-Patchwork-Id: 12627601 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9A5DCC433EF for ; Thu, 18 Nov 2021 19:30:15 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5769561507 for ; Thu, 18 Nov 2021 19:30:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5769561507 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4CAFA6E98D; Thu, 18 Nov 2021 19:30:14 +0000 (UTC) Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9A74A6E98D for ; Thu, 18 Nov 2021 19:30:12 +0000 (UTC) Received: by mail-pl1-x62a.google.com with SMTP id z6so4950113plk.6 for ; Thu, 18 Nov 2021 11:30:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=6a6XNUBiSVXYL8JcjB4TIIHPE7C73L1S2r2kenMwpgs=; b=ARw6JlgSc4uSQsvSy1AnLry+K0GYe8gJVXoEpwzdAFt1kYqveGSebR3VEHsCXYIgeM EyBMLlDwdWgFQJZiiRF2Bpjc38O1LCR0/W7JMMPclLANOq+dTu81Qg29RS1DvydwmI0H 0/lorw5B28mzpOf7PH6OvINy1pWy7XEvZWAa8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=6a6XNUBiSVXYL8JcjB4TIIHPE7C73L1S2r2kenMwpgs=; b=CDumqX/lD/0gjroq9kPyWrML1PUkNvTJRdBFCK52FWFn+QeJBgO+lFeod8OgZ4DpEk aA4oMtJaHgfSp05kcCEaDFPbCpEwgW/6Zcf1Xug+fmhYnRfEwbDvRsN9gBsKQRrsiH1A mVF1/G/jn6RZNHHCeeZGfCFTyf9z/0SitNNtzXQfeCrb34zIxXh7yi4ufBhET+9JzFOA CCijOkoZ5b4+oXKR8gp/Cl7fGHpxrwE1n11P/QEvwp0WNvQEwuw9CHv05hxre0X8h1ZN qIQkOh4bNcpUZ6THpBzIghZSnmAy82gy4GKkh4rVGvbg5A0mU2DKZHrWgCPzjerNLoE+ Ha2Q== X-Gm-Message-State: AOAM530U+Tw5yhr/aYZulphZE60e98xKdXzSLJ+GZvawwLLVX1AJhxyn F+MbQkN86NGQuX7s1mGkaJ/GoQ== X-Google-Smtp-Source: ABdhPJzBkr1Ks3Z0c9CYiyRMhPuG5ANntyNBtjJZWW0AEGpAFbPYkMIeoCEBkkh8iMPZKET/xO8cKw== X-Received: by 2002:a17:902:8a93:b0:142:30fe:dd20 with SMTP id p19-20020a1709028a9300b0014230fedd20mr68641445plo.29.1637263811954; Thu, 18 Nov 2021 11:30:11 -0800 (PST) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:4cf0:1835:2db:b2b8]) by smtp.gmail.com with ESMTPSA id mg17sm343789pjb.17.2021.11.18.11.30.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Nov 2021 11:30:11 -0800 (PST) From: Hsin-Yi Wang To: Robert Foss , Laurent Pinchart Subject: [PATCH v2] drm/bridge: anx7625: Fix edid_read break case in sp_tx_edid_read() Date: Fri, 19 Nov 2021 03:30:02 +0800 Message-Id: <20211118193002.407168-1-hsinyi@chromium.org> X-Mailer: git-send-email 2.34.0.rc2.393.gf8c9666880-goog MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Pi-Hsun Shih , Jonas Karlman , David Airlie , Neil Armstrong , linux-kernel@vger.kernel.org, Jernej Skrabec , Andrzej Hajda , dri-devel@lists.freedesktop.org, Hsin-Yi Wang , Sam Ravnborg , Xin Ji , linux@roeck-us.net Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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()") Signed-off-by: Hsin-Yi Wang Reviewed-by: Robert Foss Reviewed-by: Xin Ji --- v2: Fix type error. --- drivers/gpu/drm/bridge/analogix/anx7625.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c index 1a871f6b6822ee..3a18f1dabcfd51 100644 --- a/drivers/gpu/drm/bridge/analogix/anx7625.c +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c @@ -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],