]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
x86: tangier: pinmux: Move is_protected assignment closer to its user
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 27 Oct 2021 14:23:37 +0000 (17:23 +0300)
committerBin Meng <bmeng.cn@gmail.com>
Mon, 1 Nov 2021 02:10:11 +0000 (10:10 +0800)
Move is_protected assignment closer to its user.
This increases readability and makes maintenance easier.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
arch/x86/cpu/tangier/pinmux.c

index 8385167b2b6b03d69c05e771d2c70a6daad8509d..883860f75e283f9f3e5a7aa648776bd420b8971a 100644 (file)
@@ -162,8 +162,6 @@ static int mrfld_pinctrl_cfg_pin(ofnode pin_node)
        u32 mask;
        int ret;
 
-       is_protected = ofnode_read_bool(pin_node, "protected");
-
        pad_offset = ofnode_read_s32_default(pin_node, "pad-offset", -1);
        if (pad_offset == -1)
                return -EINVAL;
@@ -178,6 +176,7 @@ static int mrfld_pinctrl_cfg_pin(ofnode pin_node)
        if (mode & ~mask)
                return -ENOTSUPP;
 
+       is_protected = ofnode_read_bool(pin_node, "protected");
        if (is_protected)
                ret = mrfld_pinconfig_protected(pad_offset, mask, mode);
        else