summaryrefslogtreecommitdiff
path: root/drivers/i2c
diff options
context:
space:
mode:
authorSatish Nagireddy <satish.nagireddy@getcruise.com>2022-06-28 22:12:16 +0300
committerWolfram Sang <wsa@kernel.org>2022-07-08 00:06:34 +0300
commit3501f0c663063513ad604fb1b3f06af637d3396d (patch)
tree319856d43e5b7ded6e8e2ab921a956b1f7f2ac71 /drivers/i2c
parent8ad59b397f86a4d8014966fdc0552095a0c4fb2b (diff)
downloadlinux-3501f0c663063513ad604fb1b3f06af637d3396d.tar.xz
i2c: cadence: Unregister the clk notifier in error path
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>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/busses/i2c-cadence.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/i2c/busses/i2c-cadence.c b/drivers/i2c/busses/i2c-cadence.c
index b4c1ad19cdae..3d6f8ee355bf 100644
--- a/drivers/i2c/busses/i2c-cadence.c
+++ b/drivers/i2c/busses/i2c-cadence.c
@@ -1338,6 +1338,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);