aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiklas Söderlund <[email protected]>2016-11-12 17:04:26 +0100
committerGeert Uytterhoeven <[email protected]>2016-11-16 10:28:58 +0100
commit42831cf96531bf4dd9035fb8a94afe8e1fc235b3 (patch)
tree80437d1d5de8b70cfd71510334dc824703401c1e
parentc314c9f15aa5f43f0e5c0e2602cc65798dbd1598 (diff)
pinctrl: sh-pfc: r8a7795: Simplify get bias logic
The last else statement is missing braces, and the indentation level can be reduced. Suggested-by: Laurent Pinchart <[email protected]> Signed-off-by: Niklas Söderlund <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Geert Uytterhoeven <[email protected]>
-rw-r--r--drivers/pinctrl/sh-pfc/pfc-r8a7795.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a7795.c b/drivers/pinctrl/sh-pfc/pfc-r8a7795.c
index 2e8cc2adbed7..6c585634a928 100644
--- a/drivers/pinctrl/sh-pfc/pfc-r8a7795.c
+++ b/drivers/pinctrl/sh-pfc/pfc-r8a7795.c
@@ -5367,13 +5367,12 @@ static unsigned int r8a7795_pinmux_get_bias(struct sh_pfc *pfc,
reg = pullups[pin].reg;
bit = BIT(pullups[pin].bit);
- if (sh_pfc_read_reg(pfc, PUEN + reg, 32) & bit) {
- if (sh_pfc_read_reg(pfc, PUD + reg, 32) & bit)
- return PIN_CONFIG_BIAS_PULL_UP;
- else
- return PIN_CONFIG_BIAS_PULL_DOWN;
- } else
+ if (!(sh_pfc_read_reg(pfc, PUEN + reg, 32) & bit))
return PIN_CONFIG_BIAS_DISABLE;
+ else if (sh_pfc_read_reg(pfc, PUD + reg, 32) & bit)
+ return PIN_CONFIG_BIAS_PULL_UP;
+ else
+ return PIN_CONFIG_BIAS_PULL_DOWN;
}
static void r8a7795_pinmux_set_bias(struct sh_pfc *pfc, unsigned int pin,