lkml.org 
[lkml]   [2021]   [Dec]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] ASoC: mediatek: mt8195: update control for RT5682 series
On Thu, Dec 16, 2021 at 11:37:34AM +0800, Trevor Wu wrote:
> On Wed, 2021-12-15 at 16:20 +0800, Tzung-Bi Shih wrote:
> > On Wed, Dec 15, 2021 at 02:58:34PM +0800, Trevor Wu wrote:
> > > @@ -1072,6 +1119,19 @@ static int
> > > mt8195_mt6359_rt1011_rt5682_dev_probe(struct platform_device *pdev)
> > > return -EINVAL;
> > > }
> > >
> > > + priv->i2so1_mclk = devm_clk_get(&pdev->dev, "i2so1_mclk");
> > > + if (IS_ERR(priv->i2so1_mclk)) {
> > > + ret = PTR_ERR(priv->i2so1_mclk);
> > > + if (ret == -ENOENT) {
> > > + dev_dbg(&pdev->dev,
> > > + "Failed to get i2so1_mclk, defer
> > > probe\n");
> > > + return -EPROBE_DEFER;
> > > + }
> >
> > Does devm_clk_get_optional() could make the block more concise?
>
> Even though we use devm_clk_get_optional, we still have to handle the
> (-ENOENT) case in probe function. In my opinion, original
> implementation could be kept.

I am neutral to my original suggestion but devm_clk_get_optional() returns NULL if -ENONENT.

\
 
 \ /
  Last update: 2021-12-16 06:03    [W:0.078 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site