Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mtd: physmap_of_gemini: Fix disabled pinctrl state check

The condition for checking the disabled pinctrl state incorrectly checks
gf->enabled_state instead of gf->disabled_state. This causes misleading
error messages and could lead to incorrect behavior when only one of the
pinctrl states is defined.

Fix the condition to properly check gf->disabled_state.

Fixes: 9d3b5086f6d4 ("mtd: physmap_of_gemini: Handle pin control")
Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>

authored by

Chen Ni and committed by
Miquel Raynal
b7c09821 16d68d10

+1 -1
+1 -1
drivers/mtd/maps/physmap-gemini.c
··· 181 181 dev_err(dev, "no enabled pin control state\n"); 182 182 183 183 gf->disabled_state = pinctrl_lookup_state(gf->p, "disabled"); 184 - if (IS_ERR(gf->enabled_state)) { 184 + if (IS_ERR(gf->disabled_state)) { 185 185 dev_err(dev, "no disabled pin control state\n"); 186 186 } else { 187 187 ret = pinctrl_select_state(gf->p, gf->disabled_state);