[rt2x00-users] [PATCH 1/2] rt2x00: Use ioremap for SoC devices instead of KSEG1ADDR.

Gertjan van Wingerde gwingerde at gmail.com
Mon Jul 19 18:21:11 AEST 2010


On Mon, Jul 19, 2010 at 8:43 AM, Ivo Van Doorn <ivdoorn at gmail.com> wrote:
> On Mon, Jul 19, 2010 at 7:53 AM, Gertjan van Wingerde
> <gwingerde at gmail.com> wrote:
>> On 07/18/10 22:17, Helmut Schaa wrote:
>>> Am Samstag 17 Juli 2010 schrieb Gertjan van Wingerde:
>>>> Make the code a bit more portable to architectures that do not support
>>>> KSEG1ADDR.
>>>>
>>>> Signed-off-by: Gertjan van Wingerde <gwingerde at gmail.com>
>>>> ---
>>>>
>>>> Note: Compile tested only, as I do not own a SOC device.
>>>
>>> One more thing: I guess we'll need a corresponding call to iounmap as well,
>>> somewhere in the uninit code ...
>>>
>>> Helmut
>>
>> Good point. Find updated patch attached.
>>
>> Note: Once you tested this to work properly, I'll submit the patches formally.
>
> I think it should be similar to rt2x00pci:
>
>        if (rt2x00dev->csr.base) {
>                iounmap(rt2x00dev->csr.base);
>                rt2x00dev->csr.base = NULL;
>        }
>
> As far as I know iounmap doesn't check the pointer.

Yeah, but it doesn't need to. I've made sure that if ioremap fails
that then the free_reg function isn't called.

---
Gertjan.




More information about the users mailing list