lkml.org 
[lkml]   [2021]   [Nov]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/3] ASoC: stm32: dfsdm: add pm_runtime support for audio
On Thu, Nov 18, 2021 at 10:00:34AM +0100, Olivier Moysan wrote:

> ret = snd_soc_add_component(component, NULL, 0);
> - if (ret < 0)
> + if (ret < 0) {
> dev_err(&pdev->dev, "%s: Failed to register PCM platform\n",
> __func__);
> + return ret;
> + }
>
> - return ret;
> + pm_runtime_enable(&pdev->dev);

Enabling runtime PM after registering the component may potentially lead
to a race where something manages to go in and starts using the device
including what should be runtime PM stuff. That'd lead to a reference
not being taken that should be. It's unlikely to actually happen but
it's better to be safe.
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2021-11-18 14:57    [W:0.044 / U:0.820 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site