mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kishon Vijay Abraham I <kishon@ti.com>
To: Manu Gautam <mgautam@codeaurora.org>
Cc: <linux-arm-msm@vger.kernel.org>,
	"open list:GENERIC PHY FRAMEWORK" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] phy: core: Allow phy_pm_runtime_xxx API calls with NULL phy
Date: Mon, 23 Apr 2018 12:12:31 +0530	[thread overview]
Message-ID: <c8edb158-9286-6877-ce6e-36a421571d8c@ti.com> (raw)
In-Reply-To: <1521525707-23927-1-git-send-email-mgautam@codeaurora.org>



On Tuesday 20 March 2018 11:31 AM, Manu Gautam wrote:
> phy_init() and phy_exit() calls, and phy_power_on() and
> phy_power_off() already accept NULL as valid PHY reference
> and act as NOP. Extend same concept to phy runtime_pm APIs
> to keep drivers (e.g. dwc3) code simple while dealing with
> optional PHYs.
> 
> Signed-off-by: Manu Gautam <mgautam@codeaurora.org>

merged, thanks!

-Kishon

> ---
> Changes for v2:
>  - Fixed compilation warning
> 
>  drivers/phy/phy-core.c | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
> 
> diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c
> index 3c31ce5..1fda576 100644
> --- a/drivers/phy/phy-core.c
> +++ b/drivers/phy/phy-core.c
> @@ -153,6 +153,9 @@ int phy_pm_runtime_get(struct phy *phy)
>  {
>  	int ret;
>  
> +	if (!phy)
> +		return 0;
> +
>  	if (!pm_runtime_enabled(&phy->dev))
>  		return -ENOTSUPP;
>  
> @@ -168,6 +171,9 @@ int phy_pm_runtime_get_sync(struct phy *phy)
>  {
>  	int ret;
>  
> +	if (!phy)
> +		return 0;
> +
>  	if (!pm_runtime_enabled(&phy->dev))
>  		return -ENOTSUPP;
>  
> @@ -181,6 +187,9 @@ int phy_pm_runtime_get_sync(struct phy *phy)
>  
>  int phy_pm_runtime_put(struct phy *phy)
>  {
> +	if (!phy)
> +		return 0;
> +
>  	if (!pm_runtime_enabled(&phy->dev))
>  		return -ENOTSUPP;
>  
> @@ -190,6 +199,9 @@ int phy_pm_runtime_put(struct phy *phy)
>  
>  int phy_pm_runtime_put_sync(struct phy *phy)
>  {
> +	if (!phy)
> +		return 0;
> +
>  	if (!pm_runtime_enabled(&phy->dev))
>  		return -ENOTSUPP;
>  
> @@ -199,6 +211,9 @@ int phy_pm_runtime_put_sync(struct phy *phy)
>  
>  void phy_pm_runtime_allow(struct phy *phy)
>  {
> +	if (!phy)
> +		return;
> +
>  	if (!pm_runtime_enabled(&phy->dev))
>  		return;
>  
> @@ -208,6 +223,9 @@ void phy_pm_runtime_allow(struct phy *phy)
>  
>  void phy_pm_runtime_forbid(struct phy *phy)
>  {
> +	if (!phy)
> +		return;
> +
>  	if (!pm_runtime_enabled(&phy->dev))
>  		return;
>  
> 

      parent reply	other threads:[~2018-04-23  6:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-20  6:01 Manu Gautam
2018-04-16  0:02 ` Manu Gautam
2018-04-23  6:42 ` Kishon Vijay Abraham I [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=c8edb158-9286-6877-ce6e-36a421571d8c@ti.com \
    --to=kishon@ti.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgautam@codeaurora.org \
    /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®