Re: [PATCH] SPI: spi-orion: add runtime PM support

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

 



On Sat, Jun 21, 2014 at 11:32:28AM +0100, Russell King wrote:
> Add trivial runtime PM support.  This will only be of benefit on SoCs
> where the clock to the SPI interface can be shut down.

This is good but...

> +static int orion_spi_prepare_transfer(struct spi_master *master)
> +{
> +	int ret = pm_runtime_get_sync(master->dev.parent);
> +	return ret < 0 ? ret : 0;
> +}
> +
> +static int orion_spi_unprepare_transfer(struct spi_master *master)
> +{
> +	pm_runtime_mark_last_busy(master->dev.parent);
> +	pm_runtime_put_autosuspend(master->dev.parent);
> +	return 0;
> +}

...it should be possible to replace these by setting auto_runtime_pm in
the master struct.  There were a lot of drivers cut'n'pasting the same
code so this got factored out to save a little code and make sure
everyone remembered to do their error checking and so on.

Attachment: signature.asc
Description: Digital 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