RFC: change map_base type

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Wed Nov 24 09:48:37 EST 2010

On 13:39 Wed 24 Nov     , Belisko Marek wrote:
> Hi,
> fist sparse patches was accepted but doesn't fix all problems.
> There is still a lot of sparse problems which complain about incorrect type
> in functions read(bwl)/writ(bwl). Over whole codebase to this
> functions are passed
> u_long or u_int types which is not correct.
> e.g. in serial drivers is used for access to registers:
> writeb(0x07, dev->map_base + UFCON);
> In my opinion it make no sense to use:
> writeb(0x07, IOMEM(dev->map_base + UFCON));
> Instead change map_base type in include/driver.h to void __iomem *map_base
> which should fix a lot sparse problems.
> Then only board code when device is initialized use: .map_base =
> IOMEM(0x00000...)
> Make it sense or there is not necessary to touch it or other way?
it's a ressources so it's the right type as in the kernel

the driver need to cast based on it's need

as done in linux

remember with the multi-ressource it's not anymore a base address you pass
but any data

Best Regards,

More information about the barebox mailing list