linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vivek Gautam <vivek.gautam@codeaurora.org>
To: Wei Yongjun <weiyj.lk@gmail.com>, Kishon Vijay Abraham I <kishon@ti.com>
Cc: Wei Yongjun <weiyongjun1@huawei.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH -next] phy: qcom-qmp: fix return value check in qcom_qmp_phy_create()
Date: Tue, 25 Apr 2017 09:51:54 +0530	[thread overview]
Message-ID: <1665c641-f8e2-ca14-279b-e49732fcc09c@codeaurora.org> (raw)
In-Reply-To: <20170425031454.11564-1-weiyj.lk@gmail.com>



On 04/25/2017 08:44 AM, Wei Yongjun wrote:
> From: Wei Yongjun <weiyongjun1@huawei.com>
>
> In case of error, the function of_iomap() returns NULL pointer
> not ERR_PTR(). The IS_ERR() test in the return value check should
> be replaced with NULL test.
>
> Fixes: e78f3d15e115 ("phy: qcom-qmp: new qmp phy driver for qcom-chipsets")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Reviewed-by: Vivek Gautam <vivek.gautam@codeaurora.org>

> ---
>   drivers/phy/phy-qcom-qmp.c | 12 ++++++------
>   1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/phy/phy-qcom-qmp.c b/drivers/phy/phy-qcom-qmp.c
> index 727e23b..a25c29d 100644
> --- a/drivers/phy/phy-qcom-qmp.c
> +++ b/drivers/phy/phy-qcom-qmp.c
> @@ -983,16 +983,16 @@ int qcom_qmp_phy_create(struct device *dev, struct device_node *np, int id)
>   	 * Resources are indexed as: tx -> 0; rx -> 1; pcs -> 2.
>   	 */
>   	qphy->tx = of_iomap(np, 0);
> -	if (IS_ERR(qphy->tx))
> -		return PTR_ERR(qphy->tx);
> +	if (!qphy->tx)
> +		return -ENOMEM;
>   
>   	qphy->rx = of_iomap(np, 1);
> -	if (IS_ERR(qphy->rx))
> -		return PTR_ERR(qphy->rx);
> +	if (!qphy->rx)
> +		return -ENOMEM;
>   
>   	qphy->pcs = of_iomap(np, 2);
> -	if (IS_ERR(qphy->pcs))
> -		return PTR_ERR(qphy->pcs);
> +	if (!qphy->pcs)
> +		return -ENOMEM;
>   
>   	/*
>   	 * Get PHY's Pipe clock, if any. USB3 and PCIe are PIPE3
>

-- 
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

  reply	other threads:[~2017-04-25  4:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-25  3:14 [PATCH -next] phy: qcom-qmp: fix return value check in qcom_qmp_phy_create() Wei Yongjun
2017-04-25  4:21 ` Vivek Gautam [this message]
2017-05-17 10:54   ` Kishon Vijay Abraham I

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=1665c641-f8e2-ca14-279b-e49732fcc09c@codeaurora.org \
    --to=vivek.gautam@codeaurora.org \
    --cc=kishon@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=weiyj.lk@gmail.com \
    --cc=weiyongjun1@huawei.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).