[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.02.1201261504200.1851@localhost6.localdomain6>
Date: Thu, 26 Jan 2012 15:07:06 +0100 (CET)
From: Julia Lawall <julia.lawall@...6.fr>
To: Wolfram Sang <w.sang@...gutronix.de>
cc: Julia Lawall <julia.lawall@...6.fr>,
Mark Brown <broonie@...nsource.wolfsonmicro.com>,
"alsa-devel@...a-project.org" <alsa-devel@...a-project.org>,
Takashi Iwai <tiwai@...e.de>,
"kernel-janitors@...r.kernel.org" <kernel-janitors@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Dong Aisheng-B29396 <B29396@...escale.com>,
Liam Girdwood <lrg@...com>
Subject: Re: [alsa-devel] [PATCH 1/15] sound/soc/mxs/mxs-saif.c: add missing
iounmap
On Thu, 26 Jan 2012, Wolfram Sang wrote:
> 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.
I can try to do that, but it seems a little bit unintuitive. Perhaps it
would be easier for people to remember to put in error handling code when
they need it if they always have to do it? If I remove it, there will be
one call that has no test and then another call a few lines later that
does.
> Where did you get the information how
> to use devm_request_and_ioremap? I probably need to spread the word even
> more...
I saw it in Documentation/driver-model/devres.txt and then looked around
for some examples.
julia
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists