diff options
author | Wolfram Sang <wsa+renesas@sang-engineering.com> | 2018-08-08 09:59:27 +0200 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2018-08-20 14:49:24 +0200 |
commit | b07531acd55180efc95e334605f04ca1eaf4e003 (patch) | |
tree | b9201d209c03094b64125aee0b366ccab9c32820 /drivers/i2c | |
parent | 0a30446c0dca3483c384b54a431cc951e15f7e79 (diff) | |
download | linux-b07531acd55180efc95e334605f04ca1eaf4e003.tar.gz linux-b07531acd55180efc95e334605f04ca1eaf4e003.tar.bz2 linux-b07531acd55180efc95e334605f04ca1eaf4e003.zip |
i2c: rcar: refactor private flags
Use BIT macro to avoid shift-31-problem, indent a little more and use
GENMASK to make it easier to add new flags.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Ulrich Hecht <uli+renesas@fpond.eu>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/busses/i2c-rcar.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c index 791a4aa34fdd..a9f1880e2eae 100644 --- a/drivers/i2c/busses/i2c-rcar.c +++ b/drivers/i2c/busses/i2c-rcar.c @@ -19,6 +19,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ +#include <linux/bitops.h> #include <linux/clk.h> #include <linux/delay.h> #include <linux/dmaengine.h> @@ -112,9 +113,9 @@ #define ID_ARBLOST (1 << 3) #define ID_NACK (1 << 4) /* persistent flags */ -#define ID_P_NO_RXDMA (1 << 30) /* HW forbids RXDMA sometimes */ -#define ID_P_PM_BLOCKED (1 << 31) -#define ID_P_MASK (ID_P_PM_BLOCKED | ID_P_NO_RXDMA) +#define ID_P_NO_RXDMA BIT(30) /* HW forbids RXDMA sometimes */ +#define ID_P_PM_BLOCKED BIT(31) +#define ID_P_MASK GENMASK(31, 30) enum rcar_i2c_type { I2C_RCAR_GEN1, |