Skip to content

Commit

Permalink
i2c: cadence: Unregister the clk notifier in error path
Browse files Browse the repository at this point in the history
[ Upstream commit 3501f0c ]

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

Fixes: df8eb56 ("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>
  • Loading branch information
satishnagireddy authored and gregkh committed Jul 12, 2022
1 parent 26938bd commit 9b329ed
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/i2c/busses/i2c-cadence.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 9b329ed

Please sign in to comment.