Message ID | 1440904189.32046.3.camel@ingics.com (mailing list archive) |
---|---|
State | Accepted |
Commit | fd63542fc5492b86158dbd53ce5de764f171b1b6 |
Headers | show |
On Sun, Aug 30, 2015 at 5:09 AM, Axel Lin <axel.lin@ingics.com> wrote: > Use devm_ioremap_resource() instead of open code. > > Signed-off-by: Axel Lin <axel.lin@ingics.com> > --- > sound/soc/au1x/psc-i2s.c | 16 +++------------- > 1 file changed, 3 insertions(+), 13 deletions(-) > > diff --git a/sound/soc/au1x/psc-i2s.c b/sound/soc/au1x/psc-i2s.c > index e742ef6..38e853a 100644 > --- a/sound/soc/au1x/psc-i2s.c > +++ b/sound/soc/au1x/psc-i2s.c > @@ -305,19 +305,9 @@ static int au1xpsc_i2s_drvprobe(struct platform_device *pdev) > return -ENOMEM; > > iores = platform_get_resource(pdev, IORESOURCE_MEM, 0); > - if (!iores) > - return -ENODEV; > - > - ret = -EBUSY; > - if (!devm_request_mem_region(&pdev->dev, iores->start, > - resource_size(iores), > - pdev->name)) > - return -EBUSY; > - > - wd->mmio = devm_ioremap(&pdev->dev, iores->start, > - resource_size(iores)); > - if (!wd->mmio) > - return -EBUSY; > + wd->mmio = devm_ioremap_resource(&pdev->dev, iores); > + if (IS_ERR(wd->mmio)) > + return PTR_ERR(wd->mmio); > > dmares = platform_get_resource(pdev, IORESOURCE_DMA, 0); > if (!dmares) > -- Acked-by: Manuel Lauss <manuel.lauss@gmail.com>
diff --git a/sound/soc/au1x/psc-i2s.c b/sound/soc/au1x/psc-i2s.c index e742ef6..38e853a 100644 --- a/sound/soc/au1x/psc-i2s.c +++ b/sound/soc/au1x/psc-i2s.c @@ -305,19 +305,9 @@ static int au1xpsc_i2s_drvprobe(struct platform_device *pdev) return -ENOMEM; iores = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!iores) - return -ENODEV; - - ret = -EBUSY; - if (!devm_request_mem_region(&pdev->dev, iores->start, - resource_size(iores), - pdev->name)) - return -EBUSY; - - wd->mmio = devm_ioremap(&pdev->dev, iores->start, - resource_size(iores)); - if (!wd->mmio) - return -EBUSY; + wd->mmio = devm_ioremap_resource(&pdev->dev, iores); + if (IS_ERR(wd->mmio)) + return PTR_ERR(wd->mmio); dmares = platform_get_resource(pdev, IORESOURCE_DMA, 0); if (!dmares)
Use devm_ioremap_resource() instead of open code. Signed-off-by: Axel Lin <axel.lin@ingics.com> --- sound/soc/au1x/psc-i2s.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-)