]> git.baikalelectronics.ru Git - kernel.git/commit
i2c: mediatek: Fix an error handling path in mtk_i2c_probe()
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sun, 22 May 2022 12:22:07 +0000 (14:22 +0200)
committerWolfram Sang <wsa@kernel.org>
Tue, 14 Jun 2022 20:11:54 +0000 (22:11 +0200)
commitfdc4766f7a3781445b960e39fe76d1b67092c3da
treed6ea71426affa3a560d64599ca9149e14fa95a38
parent8a8d10cb5fbea26d81da0bcb44cd0633259f8389
i2c: mediatek: Fix an error handling path in mtk_i2c_probe()

The clsk are prepared, enabled, then disabled. So if an error occurs after
the disable step, they are still prepared.

Add an error handling path to unprepare the clks in such a case, as already
done in the .remove function.

Fixes: 6bd7c21db28e ("i2c: mediatek: Optimize master_xfer() and avoid circular locking")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Qii Wang <qii.wang@mediatek.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
drivers/i2c/busses/i2c-mt65xx.c