]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
i2c: cadence: Unregister the clk notifier in error path
authorSatish Nagireddy <satish.nagireddy@getcruise.com>
Tue, 28 Jun 2022 19:12:16 +0000 (12:12 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Jul 2022 14:32:22 +0000 (16:32 +0200)
[ Upstream commit 3501f0c663063513ad604fb1b3f06af637d3396d ]

This patch ensures that the clock notifier is unregistered
when driver probe is returning error.

Fixes: df8eb5691c48 ("i2c: Add driver for Cadence I2C controller")
Signed-off-by: Satish Nagireddy <satish.nagireddy@getcruise.com>
Tested-by: Lars-Peter Clausen <lars@metafoo.de>
Reviewed-by: Michal Simek <michal.simek@amd.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/i2c/busses/i2c-cadence.c

index 50e3ddba52ba7ac56e4032d36d6c9e5e545b5b09..01564bd96c624c0e98c5ac170172f520d6f32560 100644 (file)
@@ -1289,6 +1289,7 @@ static int cdns_i2c_probe(struct platform_device *pdev)
        return 0;
 
 err_clk_dis:
+       clk_notifier_unregister(id->clk, &id->clk_rate_change_nb);
        clk_disable_unprepare(id->clk);
        pm_runtime_disable(&pdev->dev);
        pm_runtime_set_suspended(&pdev->dev);