From: "Ivan T. Ivanov" <iivanov@mm-sol.com>
To: kernel-janitors@vger.kernel.org
Subject: Re: [patch v2] usb: phy: msm: change devm_ioremap() to devm_ioremap_resource()
Date: Mon, 19 May 2014 09:19:10 +0000 [thread overview]
Message-ID: <1400491150.1464.19.camel@iivanov-dev> (raw)
In-Reply-To: <20140514135447.GA17540@mwanda>
On Wed, 2014-05-14 at 16:54 +0300, Dan Carpenter wrote:
> There are several issues here:
> 1) platform_get_resource() can return NULL and that wasn't handled.
> 2) We should request the memory before we remap it, and
> devm_ioremap_resource() does that.
> 3) devm_ioremap() returns a NULL but we were checking for IS_ERR().
>
> Fixes: 6b99c68ec1f9 ('usb: phy: msm: Migrate to Managed Device Resource allocation')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> v2: the first version just swapped the IS_ERR() check for a NULL check
>
> Thanks everyone for the review. In the end, it was still a one line fix
> so I forgive you Ivan.
>
> diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c
> index c522c4f..4f88174 100644
> --- a/drivers/usb/phy/phy-msm-usb.c
> +++ b/drivers/usb/phy/phy-msm-usb.c
> @@ -1586,7 +1586,7 @@ static int msm_otg_probe(struct platform_device *pdev)
> np ? "alt_core" : "usb_hs_core_clk");
>
> res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> - motg->regs = devm_ioremap(&pdev->dev, res->start, resource_size(res));
> + motg->regs = devm_ioremap_resource(&pdev->dev, res);
Thank you Dan, but this will not going to work. Address space is
shared between this PHY driver and CI device controller driver.
First version plus adding required check for 'res' as suggested
by Sergei will fix this.
Regards,
Ivan
next prev parent reply other threads:[~2014-05-19 9:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-14 13:54 [patch v2] usb: phy: msm: change devm_ioremap() to devm_ioremap_resource() Dan Carpenter
2014-05-19 9:19 ` Ivan T. Ivanov [this message]
2014-05-19 9:39 ` Dan Carpenter
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=1400491150.1464.19.camel@iivanov-dev \
--to=iivanov@mm-sol.com \
--cc=kernel-janitors@vger.kernel.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