From patchwork Sat Mar 29 12:58:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Renner Berthing X-Patchwork-Id: 3908321 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 19153BF540 for ; Sat, 29 Mar 2014 12:59:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2165E2037D for ; Sat, 29 Mar 2014 12:59:27 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2BD85201DC for ; Sat, 29 Mar 2014 12:59:26 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WTsqu-0000Rg-VB; Sat, 29 Mar 2014 12:59:13 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WTsqo-0007A0-I0; Sat, 29 Mar 2014 12:59:06 +0000 Received: from mail-lb0-x236.google.com ([2a00:1450:4010:c04::236]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WTsql-00079Q-JO for linux-arm-kernel@lists.infradead.org; Sat, 29 Mar 2014 12:59:04 +0000 Received: by mail-lb0-f182.google.com with SMTP id n15so4620396lbi.27 for ; Sat, 29 Mar 2014 05:58:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=4z0yQlbB5r9X8WxLs/mkeKGmBIgGp2noGvnRbYSYks4=; b=op05LxmD/hY5JQp2gGJC4X2IwTrxr9rGhrSSR69WaxfEuptuEAmNcdaqmd72RTx+Zt cdUP5Zl7trmA7elZLTyYTq0rAKyblhoz2oFuNUWnzyOc3M574upFsg14fcR5FsQD+V9q 0MxR9HF7a7GRiUgdbfP4kWErDTY7mV8kFyyINMHyOhGMwuiHz8N6SEQmqINqc9U4R/tA bI959zKpKzAvr2t9J59H8vmYFByHXPzLqIcoG8N3ljfe/xPzsABgU8Ckqc1hJJTrxSDO KE8CznpYmnsalLLkNi5L697kIHGLasFnJkQTVYAuX+O/tQSy2ohRcQMo9mlUfeQnH9Er zjOw== X-Received: by 10.112.209.5 with SMTP id mi5mr1589073lbc.30.1396097919281; Sat, 29 Mar 2014 05:58:39 -0700 (PDT) Received: from localhost.localdomain (0189600560.0.fullrate.dk. [95.166.155.242]) by mx.google.com with ESMTPSA id t3sm8066995laj.15.2014.03.29.05.58.37 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 29 Mar 2014 05:58:38 -0700 (PDT) From: Emil Renner Berthing To: Greg Kroah-Hartman , Sascha Hauer Subject: [PATCH] staging: imx-drm: imx-hdmi: clean up hdmi_phy_wait_i2c_done Date: Sat, 29 Mar 2014 13:58:11 +0100 Message-Id: <1396097891-12209-1-git-send-email-kernel@esmil.dk> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140329_085903_804684_B5E64A37 X-CRM114-Status: UNSURE ( 8.92 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.9 (-) Cc: Emil Renner Berthing , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Simplify hdmi_phy_wait_i2c_done so the call to hdmi_readb is only done in one place. This also fixes a checkpatch warning. Signed-off-by: Emil Renner Berthing --- drivers/staging/imx-drm/imx-hdmi.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/staging/imx-drm/imx-hdmi.c b/drivers/staging/imx-drm/imx-hdmi.c index da71d8d..cc8d232 100644 --- a/drivers/staging/imx-drm/imx-hdmi.c +++ b/drivers/staging/imx-drm/imx-hdmi.c @@ -660,13 +660,10 @@ static inline void hdmi_phy_test_dout(struct imx_hdmi *hdmi, static bool hdmi_phy_wait_i2c_done(struct imx_hdmi *hdmi, int msec) { - unsigned char val = 0; - val = hdmi_readb(hdmi, HDMI_IH_I2CMPHY_STAT0) & 0x3; - while (!val) { + while ((hdmi_readb(hdmi, HDMI_IH_I2CMPHY_STAT0) & 0x3) == 0) { udelay(1000); if (msec-- == 0) return false; - val = hdmi_readb(hdmi, HDMI_IH_I2CMPHY_STAT0) & 0x3; } return true; }