| From fb2e5c612b9977b359e110eb3b82671b33a2dd83 Mon Sep 17 00:00:00 2001 |
| From: =?UTF-8?q?Niklas=20S=C3=B6derlund?= |
| <niklas.soderlund+renesas@ragnatech.se> |
| Date: Sat, 12 Nov 2016 17:04:26 +0100 |
| Subject: [PATCH 098/299] pinctrl: sh-pfc: r8a7795: Simplify get bias logic |
| MIME-Version: 1.0 |
| Content-Type: text/plain; charset=UTF-8 |
| Content-Transfer-Encoding: 8bit |
| |
| 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> |
| (cherry picked from commit 42831cf96531bf4dd9035fb8a94afe8e1fc235b3) |
| Signed-off-by: Simon Horman <horms+renesas@verge.net.au> |
| --- |
| drivers/pinctrl/sh-pfc/pfc-r8a7795.c | 11 +++++------ |
| 1 file changed, 5 insertions(+), 6 deletions(-) |
| |
| --- a/drivers/pinctrl/sh-pfc/pfc-r8a7795.c |
| +++ b/drivers/pinctrl/sh-pfc/pfc-r8a7795.c |
| @@ -5366,13 +5366,12 @@ static unsigned int r8a7795_pinmux_get_b |
| reg = info->reg; |
| bit = BIT(info->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, |