linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Yang Yingliang <yangyingliang@huawei.com>
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	davem@davemloft.net, kuba@kernel.org
Subject: Re: [PATCH net-next] net: mdio: mscc-miim: Use devm_platform_get_and_ioremap_resource()
Date: Thu, 10 Jun 2021 18:01:26 +0200	[thread overview]
Message-ID: <YMI3VsR/jnVVhmsh@lunn.ch> (raw)
In-Reply-To: <20210610091154.4141911-1-yangyingliang@huawei.com>

> -	dev->regs = devm_ioremap_resource(&pdev->dev, res);
> +	dev->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
>  	if (IS_ERR(dev->regs)) {

Here, only dev->regs is considered.

>  		dev_err(&pdev->dev, "Unable to map MIIM registers\n");
>  		return PTR_ERR(dev->regs);
>  	}



> +	dev->phy_regs = devm_platform_get_and_ioremap_resource(pdev, 1, &res);
> +	if (res && IS_ERR(dev->phy_regs)) {

Here you look at both res and dev->phy_regs.

This seems inconsistent. Can devm_platform_get_and_ioremap_resource()
return success despite res being NULL?

       Andrew

  reply	other threads:[~2021-06-10 16:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-10  9:11 [PATCH net-next] net: mdio: mscc-miim: Use devm_platform_get_and_ioremap_resource() Yang Yingliang
2021-06-10 16:01 ` Andrew Lunn [this message]
2021-06-11  1:35   ` Yang Yingliang
2021-06-11  3:35     ` Andrew Lunn

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=YMI3VsR/jnVVhmsh@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=yangyingliang@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).