aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorGreg Ungerer <gerg@snapgear.com>2005-09-11 21:18:10 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-11 23:43:46 -0400
commitf6515db47e6d8cb502e4b0fd7255652da4ba1393 (patch)
tree3cc5e0e31273c0c71b994dcea15d1c88efd6e6e5 /drivers/mtd
parentb0433b99339a9fdc2effe213491812556e4896fb (diff)
[PATCH] uclinux: remove use of mtd_put_device() in uclinux MTD map driver
We should not call mtd_put_device() in the uclinux MTD map driver. Also consistently use phys/virt fields of maps map_info struct, instead of mixing it with map_priv_1. Signed-off-by: Greg Ungerer <gerg@uclinux.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/maps/uclinux.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/mtd/maps/uclinux.c b/drivers/mtd/maps/uclinux.c
index 811d92e5f5b1..cc372136e852 100644
--- a/drivers/mtd/maps/uclinux.c
+++ b/drivers/mtd/maps/uclinux.c
@@ -25,9 +25,6 @@
25 25
26/****************************************************************************/ 26/****************************************************************************/
27 27
28
29/****************************************************************************/
30
31struct map_info uclinux_ram_map = { 28struct map_info uclinux_ram_map = {
32 .name = "RAM", 29 .name = "RAM",
33}; 30};
@@ -60,14 +57,15 @@ int __init uclinux_mtd_init(void)
60 struct mtd_info *mtd; 57 struct mtd_info *mtd;
61 struct map_info *mapp; 58 struct map_info *mapp;
62 extern char _ebss; 59 extern char _ebss;
60 unsigned long addr = (unsigned long) &_ebss;
63 61
64 mapp = &uclinux_ram_map; 62 mapp = &uclinux_ram_map;
65 mapp->phys = (unsigned long) &_ebss; 63 mapp->phys = addr;
66 mapp->size = PAGE_ALIGN(*((unsigned long *)((&_ebss) + 8))); 64 mapp->size = PAGE_ALIGN(ntohl(*((unsigned long *)(addr + 8))));
67 mapp->bankwidth = 4; 65 mapp->bankwidth = 4;
68 66
69 printk("uclinux[mtd]: RAM probe address=0x%x size=0x%x\n", 67 printk("uclinux[mtd]: RAM probe address=0x%x size=0x%x\n",
70 (int) mapp->map_priv_2, (int) mapp->size); 68 (int) mapp->phys, (int) mapp->size);
71 69
72 mapp->virt = ioremap_nocache(mapp->phys, mapp->size); 70 mapp->virt = ioremap_nocache(mapp->phys, mapp->size);
73 71
@@ -95,7 +93,6 @@ int __init uclinux_mtd_init(void)
95 printk("uclinux[mtd]: set %s to be root filesystem\n", 93 printk("uclinux[mtd]: set %s to be root filesystem\n",
96 uclinux_romfs[0].name); 94 uclinux_romfs[0].name);
97 ROOT_DEV = MKDEV(MTD_BLOCK_MAJOR, 0); 95 ROOT_DEV = MKDEV(MTD_BLOCK_MAJOR, 0);
98 put_mtd_device(mtd);
99 96
100 return(0); 97 return(0);
101} 98}
@@ -109,7 +106,7 @@ void __exit uclinux_mtd_cleanup(void)
109 map_destroy(uclinux_ram_mtdinfo); 106 map_destroy(uclinux_ram_mtdinfo);
110 uclinux_ram_mtdinfo = NULL; 107 uclinux_ram_mtdinfo = NULL;
111 } 108 }
112 if (uclinux_ram_map.map_priv_1) { 109 if (uclinux_ram_map.virt) {
113 iounmap((void *) uclinux_ram_map.virt); 110 iounmap((void *) uclinux_ram_map.virt);
114 uclinux_ram_map.virt = 0; 111 uclinux_ram_map.virt = 0;
115 } 112 }