[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <46a95b71.c7abd.1724b0524b8.Coremail.dinghao.liu@zju.edu.cn>
Date: Mon, 25 May 2020 16:48:47 +0800 (GMT+08:00)
From: dinghao.liu@....edu.cn
To: "Peter Ujfalusi" <peter.ujfalusi@...com>
Cc: kjlu@....edu, "Jarkko Nikula" <jarkko.nikula@...mer.com>,
"Liam Girdwood" <lgirdwood@...il.com>,
"Mark Brown" <broonie@...nel.org>,
"Jaroslav Kysela" <perex@...ex.cz>,
"Takashi Iwai" <tiwai@...e.com>, alsa-devel@...a-project.org,
linux-omap@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: Re: [PATCH] ASoC: ti: Fix runtime PM imbalance in
omap2_mcbsp_set_clks_src
>
>
> On 25/05/2020 10.22, Dinghao Liu wrote:
> > When clk_set_parent() returns an error code, a pairing
> > runtime PM usage counter increment is needed to keep the
> > counter balanced.
> >
> > Signed-off-by: Dinghao Liu <dinghao.liu@....edu.cn>
> > ---
> > sound/soc/ti/omap-mcbsp.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/sound/soc/ti/omap-mcbsp.c b/sound/soc/ti/omap-mcbsp.c
> > index 3d41ca2238d4..84b4de9b670c 100644
> > --- a/sound/soc/ti/omap-mcbsp.c
> > +++ b/sound/soc/ti/omap-mcbsp.c
> > @@ -80,6 +80,7 @@ static int omap2_mcbsp_set_clks_src(struct omap_mcbsp *mcbsp, u8 fck_src_id)
> > if (r) {
> > dev_err(mcbsp->dev, "CLKS: could not clk_set_parent() to %s\n",
> > src);
> > + pm_runtime_get_sync(mcbsp->dev);
>
> > clk_put(fck_src);
> > return r;
> > }
>
> I think it would be cleaner in this way:
>
> pm_runtime_put_sync(mcbsp->dev);
>
> r = clk_set_parent(mcbsp->fclk, fck_src);
> if (r)
> dev_err(mcbsp->dev, "CLKS: could not clk_set_parent() to %s\n",
> src);
>
> pm_runtime_get_sync(mcbsp->dev);
> clk_put(fck_src);
>
> return r;
>
> - Péter
>
> Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
> Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
Thank you for your advice! This is better and I will fix this
in the next version of patch.
Regards,
Dinghao
Powered by blists - more mailing lists