aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/imx-drm
diff options
context:
space:
mode:
authorEmil Renner Berthing <kernel@esmil.dk>2014-03-30 00:21:21 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-04-25 16:11:03 -0700
commit0e6bcf3a1539eff7a7c16af18de65f186b177ea4 (patch)
treec501b1ea49783f258c8cdb91ec9c9b1b10ef4910 /drivers/staging/imx-drm
parentstaging: imx-drm: add LVDS666 support for parallel display (diff)
downloadlinux-dev-0e6bcf3a1539eff7a7c16af18de65f186b177ea4.tar.xz
linux-dev-0e6bcf3a1539eff7a7c16af18de65f186b177ea4.zip
staging: imx-drm: imx-hdmi: clean up hdmi_phy_wait_i2c_done
Simplify hdmi_phy_wait_i2c_done so the call to hdmi_readb is only done in one place. Also check for timout before waiting as suggested by Troy Kisky. This also fixes a checkpatch warning. Signed-off-by: Emil Renner Berthing <kernel@esmil.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/imx-drm')
-rw-r--r--drivers/staging/imx-drm/imx-hdmi.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/staging/imx-drm/imx-hdmi.c b/drivers/staging/imx-drm/imx-hdmi.c
index d47dedd2cdb4..13071330acad 100644
--- a/drivers/staging/imx-drm/imx-hdmi.c
+++ b/drivers/staging/imx-drm/imx-hdmi.c
@@ -659,13 +659,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) {
- udelay(1000);
+ while ((hdmi_readb(hdmi, HDMI_IH_I2CMPHY_STAT0) & 0x3) == 0) {
if (msec-- == 0)
return false;
- val = hdmi_readb(hdmi, HDMI_IH_I2CMPHY_STAT0) & 0x3;
+ udelay(1000);
}
return true;
}