diff options
author | Richard Purdie <rpurdie@rpsys.net> | 2005-03-21 09:42:14 +0100 |
---|---|---|
committer | Thomas Gleixner <tglx@mtd.linutronix.de> | 2005-05-23 13:03:41 +0200 |
commit | 8f5a4486c05275a5f3d53c80c86a44adb7fb8823 (patch) | |
tree | 0f04ae7bf55a5201346d249e18d622acce07f969 /drivers/mtd/maps | |
parent | [MTD] Add support for more SharpSL machines and fix missing mapping init (diff) | |
download | linux-8f5a4486c05275a5f3d53c80c86a44adb7fb8823.tar.xz linux-8f5a4486c05275a5f3d53c80c86a44adb7fb8823.zip |
[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')
-rw-r--r-- | drivers/mtd/maps/sharpsl-flash.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/mtd/maps/sharpsl-flash.c b/drivers/mtd/maps/sharpsl-flash.c index c643d4c5124d..d15da6fd84c1 100644 --- a/drivers/mtd/maps/sharpsl-flash.c +++ b/drivers/mtd/maps/sharpsl-flash.c @@ -4,7 +4,7 @@ * Copyright (C) 2001 Lineo Japan, Inc. * Copyright (C) 2002 SHARP * - * $Id: sharpsl-flash.c,v 1.3 2005/03/21 00:10:21 rpurdie Exp $ + * $Id: sharpsl-flash.c,v 1.5 2005/03/21 08:42:11 rpurdie Exp $ * * based on rpxlite.c,v 1.15 2001/10/02 15:05:14 dwmw2 Exp * Handle mapping of the flash on the RPX Lite and CLLF boards @@ -57,7 +57,8 @@ int __init init_sharpsl(void) int nb_parts = 0; char *part_type = "static"; - printk(KERN_NOTICE "Sharp SL series flash device: %x at %x\n", WINDOW_SIZE, WINDOW_ADDR); + printk(KERN_NOTICE "Sharp SL series flash device: %x at %x\n", + WINDOW_SIZE, WINDOW_ADDR); sharpsl_map.virt = ioremap(WINDOW_ADDR, WINDOW_SIZE); if (!sharpsl_map.virt) { printk("Failed to ioremap\n"); @@ -74,7 +75,8 @@ int __init init_sharpsl(void) mymtd->owner = THIS_MODULE; - if (machine_is_corgi() || machine_is_shepherd() || machine_is_husky() || machine_is_poodle()) { + if (machine_is_corgi() || machine_is_shepherd() || machine_is_husky() + || machine_is_poodle()) { sharpsl_partitions[0].size=0x006d0000; sharpsl_partitions[0].offset=0x00120000; } else if (machine_is_tosa()) { @@ -83,8 +85,11 @@ int __init init_sharpsl(void) } else if (machine_is_spitz()) { sharpsl_partitions[0].size=0x006b0000; sharpsl_partitions[0].offset=0x00140000; - } else - return -ENODEV; + } else { + map_destroy(mymtd); + iounmap(sharpsl_map.virt); + return -ENODEV; + } parts = sharpsl_partitions; nb_parts = NB_OF(sharpsl_partitions); |