All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Osipenko <digetx@gmail.com>
To: Marcel Ziswiler <marcel.ziswiler@toradex.com>,
	"broonie@kernel.org" <broonie@kernel.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"jonathanh@nvidia.com" <jonathanh@nvidia.com>,
	"thierry.reding@gmail.com" <thierry.reding@gmail.com>,
	"tiwai@suse.com" <tiwai@suse.com>,
	"lgirdwood@gmail.com" <lgirdwood@gmail.com>,
	"perex@perex.cz" <perex@perex.cz>,
	"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>
Subject: Re: [PATCH 2/2] ASoC: tegra: probe deferral error reporting
Date: Sat, 21 Jul 2018 15:03:57 +0300	[thread overview]
Message-ID: <2195096.d8yV6ZqeS2@dimapc> (raw)
In-Reply-To: <1532174119.19673.24.camel@toradex.com>

On Saturday, 21 July 2018 14:55:21 MSK Marcel Ziswiler wrote:
> On Sat, 2018-07-21 at 14:17 +0300, Dmitry Osipenko wrote:
> 
> > On Saturday, 21 July 2018 12:56:15 MSK Mark Brown wrote:
> > 
> > > On Fri, Jul 20, 2018 at 12:31:07PM +0000, Marcel Ziswiler wrote:
> > > 
> > > > On Fri, 2018-07-20 at 13:16 +0100, Mark Brown wrote:
> > > > 
> > > > > >  	ac97->sync_gpio = of_get_named_gpio(pdev-
> > > > > > >
> > > > > > >dev.of_node,
> > > > > > >
> > > > > >  	
> > > > > >  	
> > > > > >  					    "nvidia,codec-
> > > > > > 
> > > > > > sync-
> > > > > > 
> > > > > > gpio", 0);
> > > > > > 
> > > > > > 
> > > > > >  	if (!gpio_is_valid(ac97->sync_gpio)) {
> > > > > > 
> > > > > > 
> > > > > > -		dev_err(&pdev->dev, "no codec-sync GPIO
> > > > > > supplied\n");
> > > > > > +		ret = ac97->sync_gpio;
> > > > > > +		dev_err(&pdev->dev, "no codec-sync GPIO
> > > > > > supplied:
> > > > > > %d\n", ret);
> > > > > > 
> > > > > > 
> > > > > >  		goto err_clk_put;
> > > > > >  	
> > > > > >  	
> > > > > >  	}
> > > > > 
> > > > > 
> > > > > This isn't reporting an error code associated with the attempt
> > > > > to
> > > > > find a
> > > > > codec-sync GPIO, it's the result of some other operation.
> > > > 
> > > > 
> > > > What exactly is then the of_get_named_gpio() above please doing
> > > > if
> > > > not getting the codec sync GPIO? I am not following you, sorry.
> > > 
> > > 
> > > It's not in any way involved in setting the value of ret, whatever
> > > value
> > > that has it's nothing to do with that operation.
> > 
> > 
> > The comment to gpio_is_valid() says that it "Returns GPIO number to
> > use with 
> > Linux generic GPIO API, or one of the errno value on the error
> > condition". 
> > Comment doesn't explicitly states that the returned GPIO number is
> > always 
> > valid, but it is kinda implied.
> 
> 
> Do you mean I should be assigning the return value of gpio_is_valid()
> to ret and use that instead?

No, gpio_is_valid() returns a boolean. I think your patch is fine as it is is.

Probably Mark meant something like this:

        ac97->sync_gpio = of_get_named_gpio(pdev->dev.of_node,
                                            "nvidia,codec-sync-gpio", 0);
        if (ac97->sync_gpio < 0) {
                ret = ac97->sync_gpio;
                dev_err(&pdev->dev, "no codec-sync GPIO supplied: %d\n", ret);
                goto err_clk_put;
        }

        if (!gpio_is_valid(ac97->sync_gpio)) {
                ret = -EINVAL;
                goto err_clk_put;
       }

But that is not needed because of_get_named_gpio() returns either a valid GPIO 
number or a error code.

  reply	other threads:[~2018-07-21 12:03 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-20  8:04 [PATCH 1/2] ASoC: tegra: improve goto error label Marcel Ziswiler
2018-07-20  8:04 ` Marcel Ziswiler
2018-07-20  8:04 ` [PATCH 2/2] ASoC: tegra: probe deferral error reporting Marcel Ziswiler
2018-07-20  8:04   ` Marcel Ziswiler
2018-07-20 12:16   ` Mark Brown
2018-07-20 12:16     ` Mark Brown
2018-07-20 12:31     ` Marcel Ziswiler
2018-07-21  9:56       ` Mark Brown
2018-07-21  9:56         ` Mark Brown
2018-07-21 10:06         ` Marcel Ziswiler
2018-07-21 10:06           ` Marcel Ziswiler
2018-07-23 10:25           ` Mark Brown
2018-07-23 10:25             ` Mark Brown
2018-07-21 11:17         ` Dmitry Osipenko
2018-07-21 11:55           ` Marcel Ziswiler
2018-07-21 11:55             ` Marcel Ziswiler
2018-07-21 12:03             ` Dmitry Osipenko [this message]
2018-07-21 12:15               ` Dmitry Osipenko
2018-07-26  8:34   ` Stefan Agner
2018-07-20 12:19 ` Applied "ASoC: tegra: improve goto error label" to the asoc tree Mark Brown
2018-07-20 12:19   ` Mark Brown
2018-07-20 12:19   ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2195096.d8yV6ZqeS2@dimapc \
    --to=digetx@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=jonathanh@nvidia.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=marcel.ziswiler@toradex.com \
    --cc=perex@perex.cz \
    --cc=thierry.reding@gmail.com \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.