aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/maps/sharpsl-flash.c
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@rpsys.net>2005-03-21 03:42:14 -0500
committerThomas Gleixner <tglx@mtd.linutronix.de>2005-05-23 07:03:41 -0400
commit8f5a4486c05275a5f3d53c80c86a44adb7fb8823 (patch)
tree0f04ae7bf55a5201346d249e18d622acce07f969 /drivers/mtd/maps/sharpsl-flash.c
parentba38069875a365a33b9b56e42dfdb71b5ce7a3a4 (diff)
[MTD] sharpsl-flash: Correct error paths
Signed-off-by: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'drivers/mtd/maps/sharpsl-flash.c')
-rw-r--r--drivers/mtd/maps/sharpsl-flash.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/mtd/maps/sharpsl-flash.c b/drivers/mtd/maps/sharpsl-flash.c
index c643d4c5124..d15da6fd84c 100644
--- a/drivers/mtd/maps/sharpsl-flash.c
+++ b/drivers/mtd/maps/sharpsl-flash.c
@@ -4,7 +4,7 @@
4 * Copyright (C) 2001 Lineo Japan, Inc. 4 * Copyright (C) 2001 Lineo Japan, Inc.
5 * Copyright (C) 2002 SHARP 5 * Copyright (C) 2002 SHARP
6 * 6 *
7 * $Id: sharpsl-flash.c,v 1.3 2005/03/21 00:10:21 rpurdie Exp $ 7 * $Id: sharpsl-flash.c,v 1.5 2005/03/21 08:42:11 rpurdie Exp $
8 * 8 *
9 * based on rpxlite.c,v 1.15 2001/10/02 15:05:14 dwmw2 Exp 9 * based on rpxlite.c,v 1.15 2001/10/02 15:05:14 dwmw2 Exp
10 * Handle mapping of the flash on the RPX Lite and CLLF boards 10 * Handle mapping of the flash on the RPX Lite and CLLF boards
@@ -57,7 +57,8 @@ int __init init_sharpsl(void)
57 int nb_parts = 0; 57 int nb_parts = 0;
58 char *part_type = "static"; 58 char *part_type = "static";
59 59
60 printk(KERN_NOTICE "Sharp SL series flash device: %x at %x\n", WINDOW_SIZE, WINDOW_ADDR); 60 printk(KERN_NOTICE "Sharp SL series flash device: %x at %x\n",
61 WINDOW_SIZE, WINDOW_ADDR);
61 sharpsl_map.virt = ioremap(WINDOW_ADDR, WINDOW_SIZE); 62 sharpsl_map.virt = ioremap(WINDOW_ADDR, WINDOW_SIZE);
62 if (!sharpsl_map.virt) { 63 if (!sharpsl_map.virt) {
63 printk("Failed to ioremap\n"); 64 printk("Failed to ioremap\n");
@@ -74,7 +75,8 @@ int __init init_sharpsl(void)
74 75
75 mymtd->owner = THIS_MODULE; 76 mymtd->owner = THIS_MODULE;
76 77
77 if (machine_is_corgi() || machine_is_shepherd() || machine_is_husky() || machine_is_poodle()) { 78 if (machine_is_corgi() || machine_is_shepherd() || machine_is_husky()
79 || machine_is_poodle()) {
78 sharpsl_partitions[0].size=0x006d0000; 80 sharpsl_partitions[0].size=0x006d0000;
79 sharpsl_partitions[0].offset=0x00120000; 81 sharpsl_partitions[0].offset=0x00120000;
80 } else if (machine_is_tosa()) { 82 } else if (machine_is_tosa()) {
@@ -83,8 +85,11 @@ int __init init_sharpsl(void)
83 } else if (machine_is_spitz()) { 85 } else if (machine_is_spitz()) {
84 sharpsl_partitions[0].size=0x006b0000; 86 sharpsl_partitions[0].size=0x006b0000;
85 sharpsl_partitions[0].offset=0x00140000; 87 sharpsl_partitions[0].offset=0x00140000;
86 } else 88 } else {
87 return -ENODEV; 89 map_destroy(mymtd);
90 iounmap(sharpsl_map.virt);
91 return -ENODEV;
92 }
88 93
89 parts = sharpsl_partitions; 94 parts = sharpsl_partitions;
90 nb_parts = NB_OF(sharpsl_partitions); 95 nb_parts = NB_OF(sharpsl_partitions);