]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ata: sata_gemini: unwind clocks on IDE pinctrl errors
authorMyeonghun Pak <mhun512@gmail.com>
Fri, 26 Jun 2026 08:58:37 +0000 (17:58 +0900)
committerDamien Le Moal <dlemoal@kernel.org>
Fri, 3 Jul 2026 04:44:18 +0000 (13:44 +0900)
gemini_sata_bridge_init() prepares and enables both SATA PCLKs, then
disables them again while keeping the clocks prepared for later bridge
start and stop operations. If gemini_setup_ide_pins() fails after that,
gemini_sata_probe() returns directly and skips the existing
out_unprep_clk unwind path.

Route the IDE pinctrl failure through out_unprep_clk so the clocks
prepared by gemini_sata_bridge_init() are unprepared before probe
fails.

Fixes: d872ced29d5f ("ata: sata_gemini: Introduce explicit IDE pin control")
Co-developed-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
Reviewed-by: Niklas Cassel <cassel@kernel.org>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
drivers/ata/sata_gemini.c

index 530ee26b301210d13b6dc854bdee5ec41b552fe6..56ae2820df5888945eb668d060952ed79cadcb7f 100644 (file)
@@ -353,7 +353,7 @@ static int gemini_sata_probe(struct platform_device *pdev)
        if (sg->ide_pins) {
                ret = gemini_setup_ide_pins(dev);
                if (ret)
-                       return ret;
+                       goto out_unprep_clk;
        }
 
        dev_info(dev, "set up the Gemini IDE/SATA nexus\n");