X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fmtd%2Fmaps%2Fdilnetpc.c;h=c299d10b33e6ee10de83511acb61ad8c9897626c;hb=4b75679f60d0ce780609cbff249769b669f4fb69;hp=f99519692cb7815d369577c0c54ede59e7332f1f;hpb=4fd5f8267dd37aaebadfabe71d9c808821eea05a;p=linux-2.6-omap-h63xx.git diff --git a/drivers/mtd/maps/dilnetpc.c b/drivers/mtd/maps/dilnetpc.c index f99519692cb..c299d10b33e 100644 --- a/drivers/mtd/maps/dilnetpc.c +++ b/drivers/mtd/maps/dilnetpc.c @@ -14,7 +14,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: dilnetpc.c,v 1.17 2004/11/28 09:40:39 dwmw2 Exp $ + * $Id: dilnetpc.c,v 1.20 2005/11/07 11:14:26 gleixner Exp $ * * The DIL/Net PC is a tiny embedded PC board made by SSV Embedded Systems * featuring the AMD Elan SC410 processor. There are two variants of this @@ -218,8 +218,8 @@ static void dnp_set_vpp(struct map_info *not_used, int on) { if(--vpp_counter == 0) setcsc(CSC_RBWR, getcsc(CSC_RBWR) | 0x4); - else if(vpp_counter < 0) - BUG(); + else + BUG_ON(vpp_counter < 0); } spin_unlock_irq(&dnpc_spin); } @@ -240,8 +240,8 @@ static void adnp_set_vpp(struct map_info *not_used, int on) { if(--vpp_counter == 0) setcsc(CSC_RBWR, getcsc(CSC_RBWR) | 0x8); - else if(vpp_counter < 0) - BUG(); + else + BUG_ON(vpp_counter < 0); } spin_unlock_irq(&dnpc_spin); } @@ -272,13 +272,13 @@ static struct map_info dnpc_map = { static struct mtd_partition partition_info[]= { - { - .name = "ADNP boot", - .offset = 0, + { + .name = "ADNP boot", + .offset = 0, .size = 0xf0000, }, - { - .name = "ADNP system BIOS", + { + .name = "ADNP system BIOS", .offset = MTDPART_OFS_NXTBLK, .size = 0x10000, #ifdef DNPC_BIOS_BLOCKS_WRITEPROTECTED @@ -291,7 +291,7 @@ static struct mtd_partition partition_info[]= .size = 0x2f0000, }, { - .name = "ADNP system BIOS entry", + .name = "ADNP system BIOS entry", .offset = MTDPART_OFS_NXTBLK, .size = MTDPART_SIZ_FULL, #ifdef DNPC_BIOS_BLOCKS_WRITEPROTECTED @@ -300,7 +300,7 @@ static struct mtd_partition partition_info[]= }, }; -#define NUM_PARTITIONS (sizeof(partition_info)/sizeof(partition_info[0])) +#define NUM_PARTITIONS ARRAY_SIZE(partition_info) static struct mtd_info *mymtd; static struct mtd_info *lowlvl_parts[NUM_PARTITIONS]; @@ -325,9 +325,9 @@ static struct mtd_info *merged_mtd; static struct mtd_partition higlvl_partition_info[]= { - { - .name = "ADNP boot block", - .offset = 0, + { + .name = "ADNP boot block", + .offset = 0, .size = CONFIG_MTD_DILNETPC_BOOTSIZE, }, { @@ -335,8 +335,8 @@ static struct mtd_partition higlvl_partition_info[]= .offset = MTDPART_OFS_NXTBLK, .size = ADNP_WINDOW_SIZE-CONFIG_MTD_DILNETPC_BOOTSIZE-0x20000, }, - { - .name = "ADNP system BIOS + BIOS Entry", + { + .name = "ADNP system BIOS + BIOS Entry", .offset = MTDPART_OFS_NXTBLK, .size = MTDPART_SIZ_FULL, #ifdef DNPC_BIOS_BLOCKS_WRITEPROTECTED @@ -345,7 +345,7 @@ static struct mtd_partition higlvl_partition_info[]= }, }; -#define NUM_HIGHLVL_PARTITIONS (sizeof(higlvl_partition_info)/sizeof(partition_info[0])) +#define NUM_HIGHLVL_PARTITIONS ARRAY_SIZE(higlvl_partition_info) static int dnp_adnp_probe(void) @@ -371,7 +371,7 @@ static int __init init_dnpc(void) /* ** determine hardware (DNP/ADNP/invalid) - */ + */ if((is_dnp = dnp_adnp_probe()) < 0) return -ENXIO; @@ -397,13 +397,13 @@ static int __init init_dnpc(void) ++dnpc_map.name; for(i = 0; i < NUM_PARTITIONS; i++) ++partition_info[i].name; - higlvl_partition_info[1].size = DNP_WINDOW_SIZE - + higlvl_partition_info[1].size = DNP_WINDOW_SIZE - CONFIG_MTD_DILNETPC_BOOTSIZE - 0x20000; for(i = 0; i < NUM_HIGHLVL_PARTITIONS; i++) ++higlvl_partition_info[i].name; } - printk(KERN_NOTICE "DIL/Net %s flash: 0x%lx at 0x%lx\n", + printk(KERN_NOTICE "DIL/Net %s flash: 0x%lx at 0x%lx\n", is_dnp ? "DNPC" : "ADNP", dnpc_map.size, dnpc_map.phys); dnpc_map.virt = ioremap_nocache(dnpc_map.phys, dnpc_map.size); @@ -436,7 +436,7 @@ static int __init init_dnpc(void) iounmap(dnpc_map.virt); return -ENXIO; } - + mymtd->owner = THIS_MODULE; /*