Re: [PATCH v2] media: Split v4l2_pipeline_pm_use into v4l2_pipeline_pm_{get, put}

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

 



Hi Ezequiel,

On Fri, Jan 24, 2020 at 05:35:43PM -0300, Ezequiel Garcia wrote:
> Currently, v4l2_pipeline_pm_use() prototype is:
> 
>   int v4l2_pipeline_pm_use(struct media_entity *entity, int use)
> 
> Where the 'use' argument shall only be set to '1' for enable/power-on,
> or to '0' for disable/power-off. The integer return is specified
> as only meaningful when 'use' is set to '1'.
> 
> Let's enforce this semantic by splitting the function in two:
> v4l2_pipeline_pm_get and v4l2_pipeline_pm_put. This is done
> for several reasons.
> 
> It makes the API easier to use (or harder to misuse).
> It removes the constraint on the values the 'use' argument
> shall take. Also, it removes the need to constraint
> the return value, by making v4l2_pipeline_pm_put void return.
> 
> And last, it's more consistent with other kernel APIs, such
> as the runtime pm APIs, which makes the code more symmetric.

Indeed. These functions only exist because not all sensor etc. drivers have
been converted to runtime PM yet. New drivers no longer implement s_power
callbacks.

I don't object the patch as such, but I think you could also add a note
that relying on the s_power callback is deprecated. This probably should be
a separate patch.

-- 
Regards,

Sakari Ailus



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux