Commit ad1f5e82 authored by Marc Kleine-Budde's avatar Marc Kleine-Budde
Browse files

can: m_can: tcan4x5x_can_probe(): fix error path: remove erroneous clk_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: 5443c226 ("can: tcan4x5x: Add tcan4x5x driver to the kernel")
Link: http://lore.kernel.org/r/20201130114252.215334-1-mkl@pengutronix.de


Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
parent 4d521943
Loading
Loading
Loading
Loading
+3 −8
Original line number Diff line number Diff line
@@ -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)
@@ -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);