[uClinux-dev] [PATCH] mtd: clean up uclinux.c map driver
Greg Ungerer
gerg at snapgear.com
Tue May 15 00:17:27 EDT 2012
On 15/05/12 14:08, gerg at snapgear.com wrote:
[snip]
> /****************************************************************************/
> @@ -65,22 +62,22 @@ static int __init uclinux_mtd_init(void)
> mapp->size = PAGE_ALIGN(ntohl(*((unsigned long *)(mapp->phys + 8))));
> mapp->bankwidth = 4;
>
> - printk("uclinux[mtd]: RAM probe address=0x%x size=0x%x\n",
> + printk(KERN_NOTICE "uclinux[mtd]: RAM probe address=0x%x size=0x%x\n",
> (int) mapp->phys, (int) mapp->size);
>
> - mapp->virt = phys_to_virt(mapp->phys);
> + mapp->virt = (void __iomem *) (unsigned long) phys_to_virt(mapp->phys);
I am a little un-easy with this casting. It would seem to indicate
some type of abuse of the virt field...
But this same thing has been done in other mtd mapping drivers, for
example drivers/mtd/maps/amd76xrom.c.
Regards
Greg
------------------------------------------------------------------------
Greg Ungerer -- Principal Engineer EMAIL: gerg at snapgear.com
SnapGear Group, McAfee PHONE: +61 7 3435 2888
8 Gardner Close FAX: +61 7 3217 5323
Milton, QLD, 4064, Australia WEB: http://www.SnapGear.com
More information about the linux-mtd
mailing list