Re: [PATCH v2 1/2] spi: orion: enable clocks before spi_setup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Dec 17, 2020 at 07:09:31PM +0200, kostap@xxxxxxxxxxx wrote:

> +	/*
> +	 * Make sure the clocks are enabled before
> +	 * configuring the SPI controller.
> +	 */
> +	clk_prepare_enable(orion_spi->clk);
> +	if (!IS_ERR(orion_spi->axi_clk))
> +		clk_prepare_enable(orion_spi->axi_clk);
> +
>  	return orion_spi_setup_transfer(spi, NULL);
>  }

There's no matching disable here so we'll leak the enables every time
setup() is called - we should unwind the enables after calling
_setup_transfer().  It may be more sensible to just take a runtime PM
reference rather than do the raw clock API stuff, one less call and
means if anything else gets added to runtime PM it'll be handled.

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux