summaryrefslogtreecommitdiffstats
path: root/drivers/net/can/ti_hecc.c
diff options
context:
space:
mode:
authorZhang Changzhong <zhangchangzhong@huawei.com>2020-07-17 10:04:39 +0200
committerMarc Kleine-Budde <mkl@pengutronix.de>2020-11-03 22:30:32 +0100
commite002103b36a695f7cb6048b96da73e66c86ddffb (patch)
treed97b28939f26bf39b765cb29880e8e80be9e4471 /drivers/net/can/ti_hecc.c
parentcan: isotp: padlen(): make const array static, makes object smaller (diff)
downloadlinux-e002103b36a695f7cb6048b96da73e66c86ddffb.tar.xz
linux-e002103b36a695f7cb6048b96da73e66c86ddffb.zip
can: ti_hecc: ti_hecc_probe(): add missed clk_disable_unprepare() in error path
The driver forgets to call clk_disable_unprepare() in error path after a success calling for clk_prepare_enable(). Fix it by adding a clk_disable_unprepare() in error path. Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com> Link: https://lore.kernel.org/r/1594973079-27743-1-git-send-email-zhangchangzhong@huawei.com Fixes: befa60113ce7 ("can: ti_hecc: add missing prepare and unprepare of the clock") Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers/net/can/ti_hecc.c')
-rw-r--r--drivers/net/can/ti_hecc.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/can/ti_hecc.c b/drivers/net/can/ti_hecc.c
index 1d63006c97bc..9913f5458279 100644
--- a/drivers/net/can/ti_hecc.c
+++ b/drivers/net/can/ti_hecc.c
@@ -933,7 +933,7 @@ static int ti_hecc_probe(struct platform_device *pdev)
err = clk_prepare_enable(priv->clk);
if (err) {
dev_err(&pdev->dev, "clk_prepare_enable() failed\n");
- goto probe_exit_clk;
+ goto probe_exit_release_clk;
}
priv->offload.mailbox_read = ti_hecc_mailbox_read;
@@ -942,7 +942,7 @@ static int ti_hecc_probe(struct platform_device *pdev)
err = can_rx_offload_add_timestamp(ndev, &priv->offload);
if (err) {
dev_err(&pdev->dev, "can_rx_offload_add_timestamp() failed\n");
- goto probe_exit_clk;
+ goto probe_exit_disable_clk;
}
err = register_candev(ndev);
@@ -960,7 +960,9 @@ static int ti_hecc_probe(struct platform_device *pdev)
probe_exit_offload:
can_rx_offload_del(&priv->offload);
-probe_exit_clk:
+probe_exit_disable_clk:
+ clk_disable_unprepare(priv->clk);
+probe_exit_release_clk:
clk_put(priv->clk);
probe_exit_candev:
free_candev(ndev);