lkml.org 
[lkml]   [2012]   [Jan]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [alsa-devel] [PATCH 1/15] sound/soc/mxs/mxs-saif.c: add missing iounmap
Julia,

> iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> @@ -663,18 +663,11 @@ static int mxs_saif_probe(struct platform_device *pdev)
> goto failed_get_resource;
> }
>
> - if (!request_mem_region(iores->start, resource_size(iores),
> - "mxs-saif")) {
> - dev_err(&pdev->dev, "request_mem_region failed\n");
> - ret = -EBUSY;
> - goto failed_get_resource;
> - }
> -
> - saif->base = ioremap(iores->start, resource_size(iores));
> + saif->base = devm_request_and_ioremap(&pdev->dev, iores);

You can skip checking 'iores', too. I also did that in the example, but
a lot of people seem to miss it. Where did you get the information how
to use devm_request_and_ioremap? I probably need to spread the word even
more...

Thanks,

Wolfram

--
Pengutronix e.K. | Wolfram Sang |
Industrial Linux Solutions | http://www.pengutronix.de/ |
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2012-01-26 14:55    [W:0.128 / U:0.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site