]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
i2c: bcm2835: Fix the error handling in 'bcm2835_i2c_probe()'
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Fri, 20 Aug 2021 18:43:33 +0000 (20:43 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 20 May 2022 12:38:48 +0000 (14:38 +0200)
commitea74076441f6c92b9d3eb36155dd4db90538c21f
tree7d3faf87782921614caf2b2766e11840b65ce03c
parent02cf397121e5ab0c952e7d39e9b40a4868d62ac2
i2c: bcm2835: Fix the error handling in 'bcm2835_i2c_probe()'

BugLink: https://bugs.launchpad.net/bugs/1969110
[ Upstream commit b205f5850263632b6897d8f0bfaeeea4955f8663 ]

Some resource should be released if an error occurs in
'bcm2835_i2c_probe()'.
Add an error handling path and the needed 'clk_disable_unprepare()' and
'clk_rate_exclusive_put()' calls.

While at it, rework the bottom of the function to use this newly added
error handling path and have an explicit and more standard "return 0;" at
the end of the normal path.

Fixes: bebff81fb8b9 ("i2c: bcm2835: Model Divider in CCF")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
[wsa: rebased]
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 0eec5e2748f15da61fae56d9b23798f3ad9d3fee)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers/i2c/busses/i2c-bcm2835.c