Skip to content

Commit

Permalink
can: m_can: tcan4x5x_can_probe(): fix error path: remove erroneous cl…
Browse files Browse the repository at this point in the history
…k_disable_unprepare()

The clocks mcan_class->cclk and mcan_class->hclk are not prepared by any call
during tcan4x5x_can_probe(), so remove erroneous clk_disable_unprepare() on
them.

Fixes: 5443c22 ("can: tcan4x5x: Add tcan4x5x driver to the kernel")
Link: http://lore.kernel.org/r/20201130114252.215334-1-mkl@pengutronix.de
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
  • Loading branch information
Marc Kleine-Budde committed Nov 30, 2020
1 parent 4d52194 commit ad1f5e8
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions drivers/net/can/m_can/tcan4x5x.c
Original file line number Diff line number Diff line change
Expand Up @@ -489,18 +489,18 @@ static int tcan4x5x_can_probe(struct spi_device *spi)
spi->bits_per_word = 32;
ret = spi_setup(spi);
if (ret)
goto out_clk;
goto out_m_can_class_free_dev;

priv->regmap = devm_regmap_init(&spi->dev, &tcan4x5x_bus,
&spi->dev, &tcan4x5x_regmap);
if (IS_ERR(priv->regmap)) {
ret = PTR_ERR(priv->regmap);
goto out_clk;
goto out_m_can_class_free_dev;
}

ret = tcan4x5x_power_enable(priv->power, 1);
if (ret)
goto out_clk;
goto out_m_can_class_free_dev;

ret = tcan4x5x_parse_config(mcan_class);
if (ret)
Expand All @@ -519,11 +519,6 @@ static int tcan4x5x_can_probe(struct spi_device *spi)

out_power:
tcan4x5x_power_enable(priv->power, 0);
out_clk:
if (!IS_ERR(mcan_class->cclk)) {
clk_disable_unprepare(mcan_class->cclk);
clk_disable_unprepare(mcan_class->hclk);
}
out_m_can_class_free_dev:
m_can_class_free_dev(mcan_class->net);
dev_err(&spi->dev, "Probe failed, err=%d\n", ret);
Expand Down

0 comments on commit ad1f5e8

Please sign in to comment.