From: <Codrin.Ciubotariu@microchip.com>
To: <bobo.shaobowang@huawei.com>
Cc: <cj.chengjian@huawei.com>, <huawei.libin@huawei.com>,
<wsa@the-dreams.de>, <linux-i2c@vger.kernel.org>,
<linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH -next] i2c: at91: Use devm_platform_get_and_ioremap_resource()
Date: Sat, 10 Oct 2020 10:11:57 +0000 [thread overview]
Message-ID: <e1761eb1-b682-7d90-204c-02ffd606d3df@microchip.com> (raw)
In-Reply-To: <20200918082140.32258-1-bobo.shaobowang@huawei.com>
On 18.09.2020 11:21, Wang ShaoBo wrote:
> Make use of devm_platform_get_and_ioremap_resource() provided by
> driver core platform instead of duplicated analogue.
>
> Signed-off-by: Wang ShaoBo <bobo.shaobowang@huawei.com>
Reviewed-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
Thanks!
> ---
> drivers/i2c/busses/i2c-at91-core.c | 11 ++++-------
> 1 file changed, 4 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-at91-core.c b/drivers/i2c/busses/i2c-at91-core.c
> index e14edd236108..5b7781302852 100644
> --- a/drivers/i2c/busses/i2c-at91-core.c
> +++ b/drivers/i2c/busses/i2c-at91-core.c
> @@ -207,19 +207,16 @@ static int at91_twi_probe(struct platform_device *pdev)
>
> dev->dev = &pdev->dev;
>
> - mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> - if (!mem)
> - return -ENODEV;
> + dev->base = devm_platform_get_and_ioremap_resource(pdev, 0, &mem);
> + if (IS_ERR(dev->base))
> + return PTR_ERR(dev->base);
> +
> phy_addr = mem->start;
>
> dev->pdata = at91_twi_get_driver_data(pdev);
> if (!dev->pdata)
> return -ENODEV;
>
> - dev->base = devm_ioremap_resource(&pdev->dev, mem);
> - if (IS_ERR(dev->base))
> - return PTR_ERR(dev->base);
> -
> dev->irq = platform_get_irq(pdev, 0);
> if (dev->irq < 0)
> return dev->irq;
> --
> 2.17.1
>
prev parent reply other threads:[~2020-10-10 19:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-18 8:21 [PATCH -next] i2c: at91: Use devm_platform_get_and_ioremap_resource() Wang ShaoBo
2020-10-10 10:11 ` Codrin.Ciubotariu [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=e1761eb1-b682-7d90-204c-02ffd606d3df@microchip.com \
--to=codrin.ciubotariu@microchip.com \
--cc=bobo.shaobowang@huawei.com \
--cc=cj.chengjian@huawei.com \
--cc=huawei.libin@huawei.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=wsa@the-dreams.de \
/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).