]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
mtd: physmap_of_gemini: Fix disabled pinctrl state check
authorChen Ni <nichen@iscas.ac.cn>
Fri, 27 Feb 2026 01:43:36 +0000 (09:43 +0800)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Wed, 11 Mar 2026 15:19:50 +0000 (16:19 +0100)
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>
drivers/mtd/maps/physmap-gemini.c

index 9d3b4bf84a1ad7cb340d916b39a281b46af8dc33..1c34b4ef77ea3f006e9087b167fca278b4132776 100644 (file)
@@ -181,7 +181,7 @@ int of_flash_probe_gemini(struct platform_device *pdev,
                dev_err(dev, "no enabled pin control state\n");
 
        gf->disabled_state = pinctrl_lookup_state(gf->p, "disabled");
-       if (IS_ERR(gf->enabled_state)) {
+       if (IS_ERR(gf->disabled_state)) {
                dev_err(dev, "no disabled pin control state\n");
        } else {
                ret = pinctrl_select_state(gf->p, gf->disabled_state);