]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
i2c: designware: Add disabling clocks when probe fails
authorKunihiko Hayashi <hayashi.kunihiko@socionext.com>
Thu, 24 Jul 2025 04:22:11 +0000 (13:22 +0900)
committerWolfram Sang <wsa+renesas@sang-engineering.com>
Fri, 26 Sep 2025 07:38:58 +0000 (09:38 +0200)
After an error occurs during probing state, dw_i2c_plat_pm_cleanup() is
called. However, this function doesn't disable clocks and the clock-enable
count keeps increasing. Should disable these clocks explicitly.

Fixes: 7272194ed391f ("i2c-designware: add minimal support for runtime PM")
Co-developed-by: Kohei Ito <ito.kohei@socionext.com>
Signed-off-by: Kohei Ito <ito.kohei@socionext.com>
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
drivers/i2c/busses/i2c-designware-platdrv.c

index 3223da7018069903a48efea5333f317d0b78d1f2..34d881572351cc4106e77a7ffb6c26509fb8443b 100644 (file)
@@ -316,6 +316,7 @@ static int dw_i2c_plat_probe(struct platform_device *pdev)
 
 exit_probe:
        dw_i2c_plat_pm_cleanup(dev);
+       i2c_dw_prepare_clk(dev, false);
 exit_reset:
        reset_control_assert(dev->rst);
        return ret;