Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8fec6f74 authored by Sachin Kamat's avatar Sachin Kamat Committed by Mark Brown
Browse files

spi: atmel: Fix incorrect error path



'irq' was not released when clk_prepare_enable failed.
Fix it.

Signed-off-by: default avatarSachin Kamat <sachin.kamat@linaro.org>
Acked-by: default avatarNicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent 57873925
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -1583,7 +1583,7 @@ static int atmel_spi_probe(struct platform_device *pdev)
	/* Initialize the hardware */
	/* Initialize the hardware */
	ret = clk_prepare_enable(clk);
	ret = clk_prepare_enable(clk);
	if (ret)
	if (ret)
		goto out_unmap_regs;
		goto out_free_irq;
	spi_writel(as, CR, SPI_BIT(SWRST));
	spi_writel(as, CR, SPI_BIT(SWRST));
	spi_writel(as, CR, SPI_BIT(SWRST)); /* AT91SAM9263 Rev B workaround */
	spi_writel(as, CR, SPI_BIT(SWRST)); /* AT91SAM9263 Rev B workaround */
	if (as->caps.has_wdrbt) {
	if (as->caps.has_wdrbt) {
@@ -1614,6 +1614,7 @@ static int atmel_spi_probe(struct platform_device *pdev)
	spi_writel(as, CR, SPI_BIT(SWRST));
	spi_writel(as, CR, SPI_BIT(SWRST));
	spi_writel(as, CR, SPI_BIT(SWRST)); /* AT91SAM9263 Rev B workaround */
	spi_writel(as, CR, SPI_BIT(SWRST)); /* AT91SAM9263 Rev B workaround */
	clk_disable_unprepare(clk);
	clk_disable_unprepare(clk);
out_free_irq:
	free_irq(irq, master);
	free_irq(irq, master);
out_unmap_regs:
out_unmap_regs:
	iounmap(as->regs);
	iounmap(as->regs);