Skip to content

Commit

Permalink
pinctrl: sh-pfc: r8a7795: Simplify get bias logic
Browse files Browse the repository at this point in the history
The last else statement is missing braces, and the indentation level can
be reduced.

Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
  • Loading branch information
Niklas Söderlund authored and Geert Uytterhoeven committed Nov 16, 2016
1 parent c314c9f commit 42831cf
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions drivers/pinctrl/sh-pfc/pfc-r8a7795.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 42831cf

Please sign in to comment.