mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alexandre Torgue <alexandre.torgue@st.com>
To: Kishon Vijay Abraham I <kishon@ti.com>
Cc: <linux-kernel@vger.kernel.org>, youling257 <youling257@gmail.com>
Subject: Re: [PATCH] phy: core: Fix phy_get() to not return error on link creation failure
Date: Tue, 18 Feb 2020 13:44:52 +0100	[thread overview]
Message-ID: <9051ea53-29d4-bd7a-675b-9c534794b7af@st.com> (raw)
In-Reply-To: <20200218121418.6292-1-kishon@ti.com>

Hi Kishon

On 2/18/20 1:14 PM, Kishon Vijay Abraham I wrote:
> commit 987351e1ea77 ("phy: core: Add consumer device link support")
> added device link support between PHY consumer and PHY provider.
> However certain peripherals (DWC3 ULPI) have cyclic dependency
> between the PHY provider and PHY consumer causing the device link
> creation to fail.
> 
> Instead of erroring out on failure to create device link, only add a
> debug print to indicate device link creation failed to get USB
> working again in multiple platforms.
> 
> Fixes: 987351e1ea77 ("phy: core: Add consumer device link support")
> Cc: Alexandre Torgue <alexandre.torgue@st.com>
> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
> ---

I was close to send it also :). Thanks for it.

Reviewed-by: Alexandre TORGUE <alexandre.torgue@st.com>

Thanks
Alex

>   drivers/phy/phy-core.c | 18 ++++++------------
>   1 file changed, 6 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c
> index cd5a6c95dbdc..a27b8d578d7f 100644
> --- a/drivers/phy/phy-core.c
> +++ b/drivers/phy/phy-core.c
> @@ -688,11 +688,9 @@ struct phy *phy_get(struct device *dev, const char *string)
>   	get_device(&phy->dev);
>   
>   	link = device_link_add(dev, &phy->dev, DL_FLAG_STATELESS);
> -	if (!link) {
> -		dev_err(dev, "failed to create device link to %s\n",
> +	if (!link)
> +		dev_dbg(dev, "failed to create device link to %s\n",
>   			dev_name(phy->dev.parent));
> -		return ERR_PTR(-EINVAL);
> -	}
>   
>   	return phy;
>   }
> @@ -803,11 +801,9 @@ struct phy *devm_of_phy_get(struct device *dev, struct device_node *np,
>   	}
>   
>   	link = device_link_add(dev, &phy->dev, DL_FLAG_STATELESS);
> -	if (!link) {
> -		dev_err(dev, "failed to create device link to %s\n",
> +	if (!link)
> +		dev_dbg(dev, "failed to create device link to %s\n",
>   			dev_name(phy->dev.parent));
> -		return ERR_PTR(-EINVAL);
> -	}
>   
>   	return phy;
>   }
> @@ -852,11 +848,9 @@ struct phy *devm_of_phy_get_by_index(struct device *dev, struct device_node *np,
>   	devres_add(dev, ptr);
>   
>   	link = device_link_add(dev, &phy->dev, DL_FLAG_STATELESS);
> -	if (!link) {
> -		dev_err(dev, "failed to create device link to %s\n",
> +	if (!link)
> +		dev_dbg(dev, "failed to create device link to %s\n",
>   			dev_name(phy->dev.parent));
> -		return ERR_PTR(-EINVAL);
> -	}
>   
>   	return phy;
>   }
> 

      reply	other threads:[~2020-02-18 12:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-18 12:14 Kishon Vijay Abraham I
2020-02-18 12:44 ` Alexandre Torgue [this message]

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=9051ea53-29d4-bd7a-675b-9c534794b7af@st.com \
    --to=alexandre.torgue@st.com \
    --cc=kishon@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=youling257@gmail.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

all inboxes | Powered by JetHome®