]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/mtd/maps/uclinux.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
[karo-tx-linux.git] / drivers / mtd / maps / uclinux.c
index 81756e397711f4a53972000472d0ef284f9903e0..d4314fb8821219c78279599a8113efab68f76b4f 100644 (file)
 
 /****************************************************************************/
 
+extern char _ebss;
+
 struct map_info uclinux_ram_map = {
        .name = "RAM",
+       .phys = (unsigned long)&_ebss,
+       .size = 0,
 };
 
-struct mtd_info *uclinux_ram_mtdinfo;
+static struct mtd_info *uclinux_ram_mtdinfo;
 
 /****************************************************************************/
 
-struct mtd_partition uclinux_romfs[] = {
+static struct mtd_partition uclinux_romfs[] = {
        { .name = "ROMfs" }
 };
 
@@ -38,7 +42,7 @@ struct mtd_partition uclinux_romfs[] = {
 
 /****************************************************************************/
 
-int uclinux_point(struct mtd_info *mtd, loff_t from, size_t len,
+static int uclinux_point(struct mtd_info *mtd, loff_t from, size_t len,
        size_t *retlen, void **virt, resource_size_t *phys)
 {
        struct map_info *map = mtd->priv;
@@ -55,12 +59,10 @@ static int __init uclinux_mtd_init(void)
 {
        struct mtd_info *mtd;
        struct map_info *mapp;
-       extern char _ebss;
-       unsigned long addr = (unsigned long) &_ebss;
 
        mapp = &uclinux_ram_map;
-       mapp->phys = addr;
-       mapp->size = PAGE_ALIGN(ntohl(*((unsigned long *)(addr + 8))));
+       if (!mapp->size)
+               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",