public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] usb: phy: msm: fix bug in probe()
@ 2014-05-19 20:35 Dan Carpenter
  2014-05-20  7:19 ` Ivan T. Ivanov
  2014-05-20  8:25 ` Dan Carpenter
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2014-05-19 20:35 UTC (permalink / raw)
  To: kernel-janitors

My previous patch introduced a bug which prevented this driver from
loading.  devm_ioremap_resource() has a call to
devm_request_mem_region() which will fail because the address space is
shared between this PHY driver and CI device controller driver.

Fixes: 10f0577aa5cb ('usb: phy: msm: change devm_ioremap() to devm_ioremap_resource()')
Reported-by:"Ivan T. Ivanov" <iivanov@mm-sol.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c
index 4f88174..ced34f3 100644
--- a/drivers/usb/phy/phy-msm-usb.c
+++ b/drivers/usb/phy/phy-msm-usb.c
@@ -1586,9 +1586,11 @@ 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_resource(&pdev->dev, res);
-	if (IS_ERR(motg->regs))
-		return PTR_ERR(motg->regs);
+	if (!res)
+		return -EINVAL;
+	motg->regs = devm_ioremap(&pdev->dev, res->start, resource_size(res));
+	if (!motg->regs)
+		return -ENOMEM;
 
 	/*
 	 * NOTE: The PHYs can be multiplexed between the chipidea controller

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [patch] usb: phy: msm: fix bug in probe()
  2014-05-19 20:35 [patch] usb: phy: msm: fix bug in probe() Dan Carpenter
@ 2014-05-20  7:19 ` Ivan T. Ivanov
  2014-05-20  8:25 ` Dan Carpenter
  1 sibling, 0 replies; 3+ messages in thread
From: Ivan T. Ivanov @ 2014-05-20  7:19 UTC (permalink / raw)
  To: kernel-janitors

On Mon, 2014-05-19 at 23:35 +0300, Dan Carpenter wrote:
> My previous patch introduced a bug which prevented this driver from
> loading.  devm_ioremap_resource() has a call to
> devm_request_mem_region() which will fail because the address space is
> shared between this PHY driver and CI device controller driver.
> 
> Fixes: 10f0577aa5cb ('usb: phy: msm: change devm_ioremap() to devm_ioremap_resource()')
> Reported-by:"Ivan T. Ivanov" <iivanov@mm-sol.com>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c
> index 4f88174..ced34f3 100644
> --- a/drivers/usb/phy/phy-msm-usb.c
> +++ b/drivers/usb/phy/phy-msm-usb.c
> @@ -1586,9 +1586,11 @@ 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_resource(&pdev->dev, res);
> -	if (IS_ERR(motg->regs))
> -		return PTR_ERR(motg->regs);
> +	if (!res)
> +		return -EINVAL;
> +	motg->regs = devm_ioremap(&pdev->dev, res->start, resource_size(res));
> +	if (!motg->regs)
> +		return -ENOMEM;

Well, I don't think that your previous patch was merged anywhere.
Or I am missing something? So you have to just made v3 of your
original patch.

Regards,
Ivan


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch] usb: phy: msm: fix bug in probe()
  2014-05-19 20:35 [patch] usb: phy: msm: fix bug in probe() Dan Carpenter
  2014-05-20  7:19 ` Ivan T. Ivanov
@ 2014-05-20  8:25 ` Dan Carpenter
  1 sibling, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2014-05-20  8:25 UTC (permalink / raw)
  To: kernel-janitors

On Tue, May 20, 2014 at 10:19:12AM +0300, Ivan T. Ivanov wrote:
> On Mon, 2014-05-19 at 23:35 +0300, Dan Carpenter wrote:
> > My previous patch introduced a bug which prevented this driver from
> > loading.  devm_ioremap_resource() has a call to
> > devm_request_mem_region() which will fail because the address space is
> > shared between this PHY driver and CI device controller driver.
> > 
> > Fixes: 10f0577aa5cb ('usb: phy: msm: change devm_ioremap() to devm_ioremap_resource()')
> > Reported-by:"Ivan T. Ivanov" <iivanov@mm-sol.com>
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> > 
> > diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c
> > index 4f88174..ced34f3 100644
> > --- a/drivers/usb/phy/phy-msm-usb.c
> > +++ b/drivers/usb/phy/phy-msm-usb.c
> > @@ -1586,9 +1586,11 @@ 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_resource(&pdev->dev, res);
> > -	if (IS_ERR(motg->regs))
> > -		return PTR_ERR(motg->regs);
> > +	if (!res)
> > +		return -EINVAL;
> > +	motg->regs = devm_ioremap(&pdev->dev, res->start, resource_size(res));
> > +	if (!motg->regs)
> > +		return -ENOMEM;
> 
> Well, I don't think that your previous patch was merged anywhere.
> Or I am missing something?

Yeah.  It was merged.

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-05-20  8:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-19 20:35 [patch] usb: phy: msm: fix bug in probe() Dan Carpenter
2014-05-20  7:19 ` Ivan T. Ivanov
2014-05-20  8:25 ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox