[PATCH v1 1/2] x86: tangier: pinmux: Move is_protected assignment closer to its user

Simon Glass sjg at chromium.org
Wed Oct 27 20:34:48 CEST 2021


On Wed, 27 Oct 2021 at 08:23, Andy Shevchenko
<andriy.shevchenko at linux.intel.com> wrote:
>
> Move is_protected assignment closer to its user.
> This increases readability and makes maintenance easier.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko at linux.intel.com>
> ---
>  arch/x86/cpu/tangier/pinmux.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

Reviewed-by: Simon Glass <sjg at chromium.org>

(with a note that normally we would read the devicetree in the
of_to_plat() method)


>
> diff --git a/arch/x86/cpu/tangier/pinmux.c b/arch/x86/cpu/tangier/pinmux.c
> index 8385167b2b6b..883860f75e28 100644
> --- a/arch/x86/cpu/tangier/pinmux.c
> +++ b/arch/x86/cpu/tangier/pinmux.c
> @@ -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
> --
> 2.33.0
>


More information about the U-Boot mailing list