Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

Greg Ungerer and committed by
Linus Torvalds
f6515db4 b0433b99

+5 -8
+5 -8
drivers/mtd/maps/uclinux.c
··· 25 25 26 26 /****************************************************************************/ 27 27 28 - 29 - /****************************************************************************/ 30 - 31 28 struct map_info uclinux_ram_map = { 32 29 .name = "RAM", 33 30 }; ··· 57 60 struct mtd_info *mtd; 58 61 struct map_info *mapp; 59 62 extern char _ebss; 63 + unsigned long addr = (unsigned long) &_ebss; 60 64 61 65 mapp = &uclinux_ram_map; 62 - mapp->phys = (unsigned long) &_ebss; 63 - mapp->size = PAGE_ALIGN(*((unsigned long *)((&_ebss) + 8))); 66 + mapp->phys = addr; 67 + mapp->size = PAGE_ALIGN(ntohl(*((unsigned long *)(addr + 8)))); 64 68 mapp->bankwidth = 4; 65 69 66 70 printk("uclinux[mtd]: RAM probe address=0x%x size=0x%x\n", 67 - (int) mapp->map_priv_2, (int) mapp->size); 71 + (int) mapp->phys, (int) mapp->size); 68 72 69 73 mapp->virt = ioremap_nocache(mapp->phys, mapp->size); 70 74 ··· 93 95 printk("uclinux[mtd]: set %s to be root filesystem\n", 94 96 uclinux_romfs[0].name); 95 97 ROOT_DEV = MKDEV(MTD_BLOCK_MAJOR, 0); 96 - put_mtd_device(mtd); 97 98 98 99 return(0); 99 100 } ··· 106 109 map_destroy(uclinux_ram_mtdinfo); 107 110 uclinux_ram_mtdinfo = NULL; 108 111 } 109 - if (uclinux_ram_map.map_priv_1) { 112 + if (uclinux_ram_map.virt) { 110 113 iounmap((void *) uclinux_ram_map.virt); 111 114 uclinux_ram_map.virt = 0; 112 115 }