X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fmtd%2Fmaps%2Fmap_funcs.c;h=38f6a7af53f8f6e85fd786f04764e1bbaaedd447;hb=9bf4aaab3e101692164d49b7ca357651eb691cb6;hp=4bb4af6c864e5c6a58f854e0858be871a637293e;hpb=db216c3d5e4c040e557a50f8f5d35d5c415e8c1c;p=linux-2.6.git diff --git a/drivers/mtd/maps/map_funcs.c b/drivers/mtd/maps/map_funcs.c index 4bb4af6c8..38f6a7af5 100644 --- a/drivers/mtd/maps/map_funcs.c +++ b/drivers/mtd/maps/map_funcs.c @@ -1,5 +1,5 @@ /* - * $Id: map_funcs.c,v 1.2 2003/05/21 15:15:07 dwmw2 Exp $ + * $Id: map_funcs.c,v 1.9 2004/07/13 22:33:15 dwmw2 Exp $ * * Out-of-line map I/O functions for simple maps when CONFIG_COMPLEX_MAPPINGS * is enabled. @@ -7,87 +7,35 @@ #include #include -#include -#include -#include -#include #include -#include -static u8 simple_map_read8(struct map_info *map, unsigned long ofs) +static map_word simple_map_read(struct map_info *map, unsigned long ofs) { - return __raw_readb(map->virt + ofs); + return inline_map_read(map, ofs); } -static u16 simple_map_read16(struct map_info *map, unsigned long ofs) +static void simple_map_write(struct map_info *map, const map_word datum, unsigned long ofs) { - return __raw_readw(map->virt + ofs); -} - -static u32 simple_map_read32(struct map_info *map, unsigned long ofs) -{ - return __raw_readl(map->virt + ofs); -} - -static u64 simple_map_read64(struct map_info *map, unsigned long ofs) -{ -#ifndef CONFIG_MTD_CFI_B8 /* 64-bit mappings */ - BUG(); - return 0; -#else - return __raw_readll(map->virt + ofs); -#endif -} - -static void simple_map_write8(struct map_info *map, u8 datum, unsigned long ofs) -{ - __raw_writeb(datum, map->virt + ofs); - mb(); -} - -static void simple_map_write16(struct map_info *map, u16 datum, unsigned long ofs) -{ - __raw_writew(datum, map->virt + ofs); - mb(); -} - -static void simple_map_write32(struct map_info *map, u32 datum, unsigned long ofs) -{ - __raw_writel(datum, map->virt + ofs); - mb(); -} - -static void simple_map_write64(struct map_info *map, u64 datum, unsigned long ofs) -{ -#ifndef CONFIG_MTD_CFI_B8 /* 64-bit mappings */ - BUG(); -#else - __raw_writell(datum, map->virt + ofs); - mb(); -#endif /* CFI_B8 */ + inline_map_write(map, datum, ofs); } static void simple_map_copy_from(struct map_info *map, void *to, unsigned long from, ssize_t len) { - memcpy_fromio(to, map->virt + from, len); + inline_map_copy_from(map, to, from, len); } static void simple_map_copy_to(struct map_info *map, unsigned long to, const void *from, ssize_t len) { - memcpy_toio(map->virt + to, from, len); + inline_map_copy_to(map, to, from, len); } void simple_map_init(struct map_info *map) { - map->read8 = simple_map_read8; - map->read16 = simple_map_read16; - map->read32 = simple_map_read32; - map->read64 = simple_map_read64; - map->write8 = simple_map_write8; - map->write16 = simple_map_write16; - map->write32 = simple_map_write32; - map->write64 = simple_map_write64; + BUG_ON(!map_bankwidth_supported(map->bankwidth)); + + map->read = simple_map_read; + map->write = simple_map_write; map->copy_from = simple_map_copy_from; map->copy_to = simple_map_copy_to; }