All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Kieran Bingham <kieranbingham@gmail.com>
Cc: Wolfram Sang <wsa@the-dreams.de>,
	Linux I2C <linux-i2c@vger.kernel.org>,
	lkml <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] i2c: return probe deferred status on dev_pm_domain_attach
Date: Mon, 12 Oct 2015 13:17:41 -0700	[thread overview]
Message-ID: <CAKdAkRSvhX97NbG2=0qq5RPsUwOVHyz4jcxUxfttWfw1wERyNw@mail.gmail.com> (raw)
In-Reply-To: <1444679344-27284-1-git-send-email-kieranbingham@gmail.com>

On Mon, Oct 12, 2015 at 12:49 PM, Kieran Bingham
<kieranbingham@gmail.com> wrote:
> A change of return status was introduced in commit 3fffd1283927
> ("i2c: allow specifying separate wakeup interrupt in device tree")
>
> The commit prevents the defer status being passed up the call stack
> appropriately when dev_pm_domain_attach returns -EPROBE_DEFER.

Ah, indeed, sorry about that.

>
> Catch the PROBE_DEFER and clear up the IRQ wakeup status
>
> Signed-off-by: Kieran Bingham <kieranbingham@gmail.com>
> Fixes: 3fffd1283927 ("i2c: allow specifying separate wakeup
> interrupt in device tree")
>
> ---
> V2:
>  Fall through the error path before returning -EPROBE_DEFER
>
>  drivers/i2c/i2c-core.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
> index 5f89f1e3c2f2..51f20cce1732 100644
> --- a/drivers/i2c/i2c-core.c
> +++ b/drivers/i2c/i2c-core.c
> @@ -699,6 +699,8 @@ static int i2c_device_probe(struct device *dev)
>                                         client));
>                 if (status)
>                         goto err_detach_pm_domain;
> +       } else {
> +               goto err_clear_wakeup_irq;
>         }

How about we do:

        status = dev_pm_domain_attach(&client->dev, true);
        if (status == -EPROBE_DEFER)
                goto err_clear_wakeup_irq;

        status = driver->probe(client, i2c_match_id(driver->id_table, client));
        ....

instead of doing "else"?

Thanks.

-- 
Dmitry

  reply	other threads:[~2015-10-12 20:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-12 19:49 [PATCH v2] i2c: return probe deferred status on dev_pm_domain_attach Kieran Bingham
2015-10-12 20:17 ` Dmitry Torokhov [this message]
2015-10-12 20:50   ` Kieran Bingham

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='CAKdAkRSvhX97NbG2=0qq5RPsUwOVHyz4jcxUxfttWfw1wERyNw@mail.gmail.com' \
    --to=dmitry.torokhov@gmail.com \
    --cc=kieranbingham@gmail.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wsa@the-dreams.de \
    /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.