/*
- * $Id: arctic-mtd.c,v 1.10 2003/06/02 16:37:59 trini Exp $
- *
- * drivers/mtd/maps/arctic-mtd.c MTD mappings and partition tables for
+ * $Id: arctic-mtd.c,v 1.14 2005/11/07 11:14:26 gleixner Exp $
+ *
+ * drivers/mtd/maps/arctic-mtd.c MTD mappings and partition tables for
* IBM 405LP Arctic boards.
*
* This program is free software; you can redistribute it and/or modify
static struct map_info arctic_mtd_map = {
.name = NAME,
.size = SIZE,
- .buswidth = BUSWIDTH,
+ .bankwidth = BUSWIDTH,
.phys = PADDR,
};
static int __init
init_arctic_mtd(void)
{
+ int err;
+
printk("%s: 0x%08x at 0x%08x\n", NAME, SIZE, PADDR);
- arctic_mtd_map.virt = (unsigned long) ioremap(PADDR, SIZE);
+ arctic_mtd_map.virt = ioremap(PADDR, SIZE);
if (!arctic_mtd_map.virt) {
printk("%s: failed to ioremap 0x%x\n", NAME, PADDR);
printk("%s: probing %d-bit flash bus\n", NAME, BUSWIDTH * 8);
arctic_mtd = do_map_probe("cfi_probe", &arctic_mtd_map);
- if (!arctic_mtd)
+ if (!arctic_mtd) {
+ iounmap(arctic_mtd_map.virt);
return -ENXIO;
+ }
arctic_mtd->owner = THIS_MODULE;
- return add_mtd_partitions(arctic_mtd, arctic_partitions, PARTITIONS);
+ err = add_mtd_partitions(arctic_mtd, arctic_partitions, PARTITIONS);
+ if (err) {
+ printk("%s: add_mtd_partitions failed\n", NAME);
+ iounmap(arctic_mtd_map.virt);
+ }
+
+ return err;
}
static void __exit