linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Shawn Lin <shawn.lin@rock-chips.com>
Cc: Murali Karicheri <m-karicheri2@ti.com>,
	Bjorn Helgaas <bhelgaas@google.com>,
	linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] PCI/keystone: check return value of devm_phy_get with EPROBE_DEFER
Date: Fri, 11 Mar 2016 12:38:23 -0600	[thread overview]
Message-ID: <20160311183823.GE4725@localhost> (raw)
In-Reply-To: <1457325141-1354-1-git-send-email-shawn.lin@rock-chips.com>

On Mon, Mar 07, 2016 at 12:32:21PM +0800, Shawn Lin wrote:
> If the return value of devm_phy_get is EPROBE_DEFER, we should
> defer probing the driver.
> 
> Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>

Applied to pci/host-keystone for v4.6 with the following changelog.
Thanks, Shawn!

    PCI: keystone: Defer probing if devm_phy_get() returns -EPROBE_DEFER
    
    A SerDes PHY is optional, so if devm_phy_get() doesn't find one at all,
    that's fine.  But if devm_phy_get() finds a PHY that doesn't have a driver
    yet, it returns -EPROBE_DEFER.  In that case, defer probing the Keystone
    driver.  We may be able to load it later after a PHY driver is loaded.
    
    [bhelgaas: changelog]
    Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
    Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>

> ---
> 
>  drivers/pci/host/pci-keystone.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/pci/host/pci-keystone.c b/drivers/pci/host/pci-keystone.c
> index 0aa81bd..42af6ac 100644
> --- a/drivers/pci/host/pci-keystone.c
> +++ b/drivers/pci/host/pci-keystone.c
> @@ -363,6 +363,8 @@ static int __init ks_pcie_probe(struct platform_device *pdev)
>  		ret = phy_init(phy);
>  		if (ret < 0)
>  			return ret;
> +	} else if (PTR_ERR(phy) == -EPROBE_DEFER) {
> +		return PTR_ERR(phy);
>  	}
>  
>  	/* index 2 is to read PCI DEVICE_ID */
> -- 
> 2.3.7
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pci" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2016-03-11 18:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-07  4:32 [PATCH] PCI/keystone: check return value of devm_phy_get with EPROBE_DEFER Shawn Lin
2016-03-11 18:38 ` Bjorn Helgaas [this message]
2016-03-11 23:33   ` Bjorn Helgaas

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=20160311183823.GE4725@localhost \
    --to=helgaas@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=m-karicheri2@ti.com \
    --cc=shawn.lin@rock-chips.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).