aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/maps/bast-flash.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2005-11-07 13:24:08 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-07 13:24:08 -0500
commitb3ce1debe2685383a9ad6ace9c49869c3968c013 (patch)
treedcb606fac467d6ce78a9c608a1e0d2323af44f2b /drivers/mtd/maps/bast-flash.c
parent5b2f7ffcb734d3046144dfbd5ac6d76254a9e522 (diff)
parentc2965f1129ee54afcc4ef293ff0f25fa3a7e7392 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/tglx/mtd-2.6
Some manual fixups for clashing kfree() cleanups etc.
Diffstat (limited to 'drivers/mtd/maps/bast-flash.c')
-rw-r--r--drivers/mtd/maps/bast-flash.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/mtd/maps/bast-flash.c b/drivers/mtd/maps/bast-flash.c
index 8c19d722ac7..b7858eb9353 100644
--- a/drivers/mtd/maps/bast-flash.c
+++ b/drivers/mtd/maps/bast-flash.c
@@ -9,7 +9,7 @@
9 * 20-Sep-2004 BJD Initial version 9 * 20-Sep-2004 BJD Initial version
10 * 17-Jan-2005 BJD Add whole device if no partitions found 10 * 17-Jan-2005 BJD Add whole device if no partitions found
11 * 11 *
12 * $Id: bast-flash.c,v 1.2 2005/01/18 11:13:47 bjd Exp $ 12 * $Id: bast-flash.c,v 1.5 2005/11/07 11:14:26 gleixner Exp $
13 * 13 *
14 * This program is free software; you can redistribute it and/or modify 14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by 15 * it under the terms of the GNU General Public License as published by
@@ -75,7 +75,7 @@ static void bast_flash_setrw(int to)
75 75
76 local_irq_save(flags); 76 local_irq_save(flags);
77 val = __raw_readb(BAST_VA_CTRL3); 77 val = __raw_readb(BAST_VA_CTRL3);
78 78
79 if (to) 79 if (to)
80 val |= BAST_CPLD_CTRL3_ROMWEN; 80 val |= BAST_CPLD_CTRL3_ROMWEN;
81 else 81 else
@@ -93,7 +93,7 @@ static int bast_flash_remove(struct device *dev)
93 93
94 dev_set_drvdata(dev, NULL); 94 dev_set_drvdata(dev, NULL);
95 95
96 if (info == NULL) 96 if (info == NULL)
97 return 0; 97 return 0;
98 98
99 if (info->map.virt != NULL) 99 if (info->map.virt != NULL)
@@ -110,7 +110,7 @@ static int bast_flash_remove(struct device *dev)
110 release_resource(info->area); 110 release_resource(info->area);
111 kfree(info->area); 111 kfree(info->area);
112 } 112 }
113 113
114 kfree(info); 114 kfree(info);
115 115
116 return 0; 116 return 0;
@@ -137,15 +137,15 @@ static int bast_flash_probe(struct device *dev)
137 137
138 info->map.phys = res->start; 138 info->map.phys = res->start;
139 info->map.size = res->end - res->start + 1; 139 info->map.size = res->end - res->start + 1;
140 info->map.name = dev->bus_id; 140 info->map.name = dev->bus_id;
141 info->map.bankwidth = 2; 141 info->map.bankwidth = 2;
142 142
143 if (info->map.size > AREA_MAXSIZE) 143 if (info->map.size > AREA_MAXSIZE)
144 info->map.size = AREA_MAXSIZE; 144 info->map.size = AREA_MAXSIZE;
145 145
146 pr_debug("%s: area %08lx, size %ld\n", __FUNCTION__, 146 pr_debug("%s: area %08lx, size %ld\n", __FUNCTION__,
147 info->map.phys, info->map.size); 147 info->map.phys, info->map.size);
148 148
149 info->area = request_mem_region(res->start, info->map.size, 149 info->area = request_mem_region(res->start, info->map.size,
150 pdev->name); 150 pdev->name);
151 if (info->area == NULL) { 151 if (info->area == NULL) {
@@ -162,7 +162,7 @@ static int bast_flash_probe(struct device *dev)
162 err = -EIO; 162 err = -EIO;
163 goto exit_error; 163 goto exit_error;
164 } 164 }
165 165
166 simple_map_init(&info->map); 166 simple_map_init(&info->map);
167 167
168 /* enable the write to the flash area */ 168 /* enable the write to the flash area */
@@ -187,7 +187,7 @@ static int bast_flash_probe(struct device *dev)
187 err = parse_mtd_partitions(info->mtd, probes, &info->partitions, 0); 187 err = parse_mtd_partitions(info->mtd, probes, &info->partitions, 0);
188 if (err > 0) { 188 if (err > 0) {
189 err = add_mtd_partitions(info->mtd, info->partitions, err); 189 err = add_mtd_partitions(info->mtd, info->partitions, err);
190 if (err) 190 if (err)
191 printk(KERN_ERR PFX "cannot add/parse partitions\n"); 191 printk(KERN_ERR PFX "cannot add/parse partitions\n");
192 } else { 192 } else {
193 err = add_mtd_device(info->mtd); 193 err = add_mtd_device(info->mtd);
@@ -205,6 +205,7 @@ static int bast_flash_probe(struct device *dev)
205 205
206static struct device_driver bast_flash_driver = { 206static struct device_driver bast_flash_driver = {
207 .name = "bast-nor", 207 .name = "bast-nor",
208 .owner = THIS_MODULE,
208 .bus = &platform_bus_type, 209 .bus = &platform_bus_type,
209 .probe = bast_flash_probe, 210 .probe = bast_flash_probe,
210 .remove = bast_flash_remove, 211 .remove = bast_flash_remove,