All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kishon Vijay Abraham I <kishon@ti.com>
To: Axel Lin <axel.lin@ingics.com>
Cc: Pratyush Anand <pratyush.anand@st.com>,
	Peter Griffin <peter.griffin@linaro.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] phy: spear1310-miphy: Return proper error for spear1310_miphy_xlate
Date: Tue, 31 Mar 2015 21:39:02 +0530	[thread overview]
Message-ID: <551AC69E.3050407@ti.com> (raw)
In-Reply-To: <1427274093.2613.0.camel@phoenix>

Hi,

On Wednesday 25 March 2015 02:31 PM, Axel Lin wrote:
> The of_xlate callback should return ERR_PTR on error.
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> ---
>   drivers/phy/phy-spear1310-miphy.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/phy/phy-spear1310-miphy.c b/drivers/phy/phy-spear1310-miphy.c
> index 9f47fae..4684b04 100644
> --- a/drivers/phy/phy-spear1310-miphy.c
> +++ b/drivers/phy/phy-spear1310-miphy.c
> @@ -192,14 +192,14 @@ static struct phy *spear1310_miphy_xlate(struct device *dev,
>
>   	if (args->args_count < 1) {
>   		dev_err(dev, "DT did not pass correct no of args\n");
> -		return NULL;
> +		return ERR_PTR(-EINVAL);

It should actually be -ENODEV so that phy_optional_get() doesn't fail.
>   	}
>
>   	priv->mode = args->args[0];
>
>   	if (priv->mode != SATA && priv->mode != PCIE) {
>   		dev_err(dev, "DT did not pass correct phy mode\n");
> -		return NULL;
> +		return ERR_PTR(-EINVAL);

Same here.

Thanks
Kishon

      parent reply	other threads:[~2015-03-31 16:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-25  9:01 [PATCH 1/2] phy: spear1310-miphy: Return proper error for spear1310_miphy_xlate Axel Lin
2015-03-25  9:03 ` [PATCH 2/2] phy: spear1340-miphy: Return proper error for spear1340_miphy_xlate Axel Lin
2015-03-31 16:09 ` 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=551AC69E.3050407@ti.com \
    --to=kishon@ti.com \
    --cc=axel.lin@ingics.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peter.griffin@linaro.org \
    --cc=pratyush.anand@st.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.