summaryrefslogtreecommitdiffstats
path: root/drivers/staging/sm750fb/ddk750_hwi2c.c
diff options
context:
space:
mode:
authorMike Rapoport <mike.rapoport@gmail.com>2016-02-10 18:34:21 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-02-11 19:52:37 -0800
commit3e155b813406fbb4aed1a54eecd24a90cf13dd96 (patch)
treeb23f43c758ae3aca64a0767f55493cff68666e93 /drivers/staging/sm750fb/ddk750_hwi2c.c
parentb71413e0d557684293a10fb1cd5747956ef42bd4 (diff)
downloadlinux-stable-3e155b813406fbb4aed1a54eecd24a90cf13dd96.tar.gz
linux-stable-3e155b813406fbb4aed1a54eecd24a90cf13dd96.tar.bz2
linux-stable-3e155b813406fbb4aed1a54eecd24a90cf13dd96.zip
staging: sm750fb: use BIT macro for I2C_STATUS fields
Replace complex definition of I2C_STATUS register fields with BIT() macro and use open-coded implementation for register manipulation Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/sm750fb/ddk750_hwi2c.c')
-rw-r--r--drivers/staging/sm750fb/ddk750_hwi2c.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/staging/sm750fb/ddk750_hwi2c.c b/drivers/staging/sm750fb/ddk750_hwi2c.c
index 1811c4bd007f..231c02114ed4 100644
--- a/drivers/staging/sm750fb/ddk750_hwi2c.c
+++ b/drivers/staging/sm750fb/ddk750_hwi2c.c
@@ -59,9 +59,7 @@ static long hw_i2c_wait_tx_done(void)
/* Wait until the transfer is completed. */
timeout = HWI2C_WAIT_TIMEOUT;
- while ((FIELD_GET(PEEK32(I2C_STATUS),
- I2C_STATUS, TX) != I2C_STATUS_TX_COMPLETED) &&
- (timeout != 0))
+ while (!(PEEK32(I2C_STATUS) & I2C_STATUS_TX) && (timeout != 0))
timeout--;
if (timeout == 0)