pinctrl: mediatek: move bit assignment

The bit needs offset to be defined which happens some lines
below. Looks like a bug. The kernel test robot complains:

drivers/pinctrl/mediatek/pinctrl-mtk-common.c:137:12:
warning: variable 'offset' is uninitialized when used here [-Wuninitialized]
           bit = BIT(offset & pctl->devdata->mode_mask);
                     ^~~~~~

Fix it up by reverting to what was done before.

Cc: Fabien Parent <[email protected]>
Cc: Sean Wang <[email protected]>
Cc: Matthias Brugger <[email protected]>
Cc: Mattijs Korpershoek <[email protected]>
Cc: [email protected]
Fixes: 9f940d8ecf ("pinctrl: mediatek: don't hardcode mode encoding in common code")
Reported-by: kernel test robot <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
This commit is contained in:
Linus Walleij
2021-05-28 11:19:10 +02:00
parent 07d5136f9b
commit 696beef775
@@ -134,7 +134,7 @@ static int mtk_pconf_set_ies_smt(struct mtk_pinctrl *pctl, unsigned pin,
pin, pctl->devdata->port_align, value, arg);
}
bit = BIT(offset & pctl->devdata->mode_mask);
bit = BIT(pin & 0xf);
if (arg == PIN_CONFIG_INPUT_ENABLE)
offset = pctl->devdata->ies_offset;