summaryrefslogtreecommitdiffstats
path: root/kernel/drivers/mtd/maps
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/drivers/mtd/maps')
-rw-r--r--kernel/drivers/mtd/maps/Kconfig2
-rw-r--r--kernel/drivers/mtd/maps/amd76xrom.c2
-rw-r--r--kernel/drivers/mtd/maps/esb2rom.c2
-rw-r--r--kernel/drivers/mtd/maps/gpio-addr-flash.c2
-rw-r--r--kernel/drivers/mtd/maps/ichxrom.c2
-rw-r--r--kernel/drivers/mtd/maps/intel_vr_nor.c2
-rw-r--r--kernel/drivers/mtd/maps/ixp4xx.c2
-rw-r--r--kernel/drivers/mtd/maps/lantiq-flash.c6
-rw-r--r--kernel/drivers/mtd/maps/latch-addr-flash.c2
-rw-r--r--kernel/drivers/mtd/maps/nettel.c13
-rw-r--r--kernel/drivers/mtd/maps/pcmciamtd.c1
-rw-r--r--kernel/drivers/mtd/maps/physmap.c1
-rw-r--r--kernel/drivers/mtd/maps/physmap_of.c11
-rw-r--r--kernel/drivers/mtd/maps/plat-ram.c1
-rw-r--r--kernel/drivers/mtd/maps/pxa2xx-flash.c8
-rw-r--r--kernel/drivers/mtd/maps/rbtx4939-flash.c2
-rw-r--r--kernel/drivers/mtd/maps/sa1100-flash.c2
17 files changed, 35 insertions, 26 deletions
diff --git a/kernel/drivers/mtd/maps/Kconfig b/kernel/drivers/mtd/maps/Kconfig
index e715ae906..7c95a656f 100644
--- a/kernel/drivers/mtd/maps/Kconfig
+++ b/kernel/drivers/mtd/maps/Kconfig
@@ -326,7 +326,7 @@ config MTD_BFIN_ASYNC
config MTD_GPIO_ADDR
tristate "GPIO-assisted Flash Chip Support"
- depends on GPIOLIB
+ depends on GPIOLIB || COMPILE_TEST
depends on MTD_COMPLEX_MAPPINGS
help
Map driver which allows flashes to be partially physically addressed
diff --git a/kernel/drivers/mtd/maps/amd76xrom.c b/kernel/drivers/mtd/maps/amd76xrom.c
index f7207b0a7..f2b68667e 100644
--- a/kernel/drivers/mtd/maps/amd76xrom.c
+++ b/kernel/drivers/mtd/maps/amd76xrom.c
@@ -138,7 +138,7 @@ static int amd76xrom_init_one(struct pci_dev *pdev,
/*
* Try to reserve the window mem region. If this fails then
* it is likely due to a fragment of the window being
- * "reseved" by the BIOS. In the case that the
+ * "reserved" by the BIOS. In the case that the
* request_mem_region() fails then once the rom size is
* discovered we will try to reserve the unreserved fragment.
*/
diff --git a/kernel/drivers/mtd/maps/esb2rom.c b/kernel/drivers/mtd/maps/esb2rom.c
index f784cf0ca..76ed651b5 100644
--- a/kernel/drivers/mtd/maps/esb2rom.c
+++ b/kernel/drivers/mtd/maps/esb2rom.c
@@ -234,7 +234,7 @@ static int esb2rom_init_one(struct pci_dev *pdev,
/*
* Try to reserve the window mem region. If this fails then
- * it is likely due to the window being "reseved" by the BIOS.
+ * it is likely due to the window being "reserved" by the BIOS.
*/
window->rsrc.name = MOD_NAME;
window->rsrc.start = window->phys;
diff --git a/kernel/drivers/mtd/maps/gpio-addr-flash.c b/kernel/drivers/mtd/maps/gpio-addr-flash.c
index 2fb346091..385305e66 100644
--- a/kernel/drivers/mtd/maps/gpio-addr-flash.c
+++ b/kernel/drivers/mtd/maps/gpio-addr-flash.c
@@ -266,7 +266,7 @@ static int gpio_flash_probe(struct platform_device *pdev)
kfree(state);
return -ENXIO;
}
-
+ state->mtd->dev.parent = &pdev->dev;
mtd_device_parse_register(state->mtd, part_probe_types, NULL,
pdata->parts, pdata->nr_parts);
diff --git a/kernel/drivers/mtd/maps/ichxrom.c b/kernel/drivers/mtd/maps/ichxrom.c
index c7478e18f..8636bba42 100644
--- a/kernel/drivers/mtd/maps/ichxrom.c
+++ b/kernel/drivers/mtd/maps/ichxrom.c
@@ -167,7 +167,7 @@ static int ichxrom_init_one(struct pci_dev *pdev,
/*
* Try to reserve the window mem region. If this fails then
- * it is likely due to the window being "reseved" by the BIOS.
+ * it is likely due to the window being "reserved" by the BIOS.
*/
window->rsrc.name = MOD_NAME;
window->rsrc.start = window->phys;
diff --git a/kernel/drivers/mtd/maps/intel_vr_nor.c b/kernel/drivers/mtd/maps/intel_vr_nor.c
index 5ab71f0e1..8bf79775e 100644
--- a/kernel/drivers/mtd/maps/intel_vr_nor.c
+++ b/kernel/drivers/mtd/maps/intel_vr_nor.c
@@ -90,7 +90,7 @@ static int vr_nor_mtd_setup(struct vr_nor_mtd *p)
if (!p->info)
return -ENODEV;
- p->info->owner = THIS_MODULE;
+ p->info->dev.parent = &p->dev->dev;
return 0;
}
diff --git a/kernel/drivers/mtd/maps/ixp4xx.c b/kernel/drivers/mtd/maps/ixp4xx.c
index b44307410..e3180d5aa 100644
--- a/kernel/drivers/mtd/maps/ixp4xx.c
+++ b/kernel/drivers/mtd/maps/ixp4xx.c
@@ -226,7 +226,7 @@ static int ixp4xx_flash_probe(struct platform_device *dev)
err = -ENXIO;
goto Error;
}
- info->mtd->owner = THIS_MODULE;
+ info->mtd->dev.parent = &dev->dev;
/* Use the fast version */
info->map.write = ixp4xx_write16;
diff --git a/kernel/drivers/mtd/maps/lantiq-flash.c b/kernel/drivers/mtd/maps/lantiq-flash.c
index 33d26f5be..938520549 100644
--- a/kernel/drivers/mtd/maps/lantiq-flash.c
+++ b/kernel/drivers/mtd/maps/lantiq-flash.c
@@ -45,7 +45,6 @@ struct ltq_mtd {
};
static const char ltq_map_name[] = "ltq_nor";
-static const char * const ltq_probe_types[] = { "cmdlinepart", "ofpart", NULL };
static map_word
ltq_read16(struct map_info *map, unsigned long adr)
@@ -161,15 +160,14 @@ ltq_mtd_probe(struct platform_device *pdev)
return -ENXIO;
}
- ltq_mtd->mtd->owner = THIS_MODULE;
+ ltq_mtd->mtd->dev.parent = &pdev->dev;
cfi = ltq_mtd->map->fldrv_priv;
cfi->addr_unlock1 ^= 1;
cfi->addr_unlock2 ^= 1;
ppdata.of_node = pdev->dev.of_node;
- err = mtd_device_parse_register(ltq_mtd->mtd, ltq_probe_types,
- &ppdata, NULL, 0);
+ err = mtd_device_parse_register(ltq_mtd->mtd, NULL, &ppdata, NULL, 0);
if (err) {
dev_err(&pdev->dev, "failed to add partitions\n");
goto err_destroy;
diff --git a/kernel/drivers/mtd/maps/latch-addr-flash.c b/kernel/drivers/mtd/maps/latch-addr-flash.c
index cadfbe051..6dc97aa66 100644
--- a/kernel/drivers/mtd/maps/latch-addr-flash.c
+++ b/kernel/drivers/mtd/maps/latch-addr-flash.c
@@ -195,7 +195,7 @@ static int latch_addr_flash_probe(struct platform_device *dev)
err = -ENODEV;
goto iounmap;
}
- info->mtd->owner = THIS_MODULE;
+ info->mtd->dev.parent = &dev->dev;
mtd_device_parse_register(info->mtd, NULL, NULL,
latch_addr_data->parts,
diff --git a/kernel/drivers/mtd/maps/nettel.c b/kernel/drivers/mtd/maps/nettel.c
index eadcfffc4..a577ef855 100644
--- a/kernel/drivers/mtd/maps/nettel.c
+++ b/kernel/drivers/mtd/maps/nettel.c
@@ -385,20 +385,28 @@ static int __init nettel_init(void)
}
rc = mtd_device_register(intel_mtd, nettel_intel_partitions,
num_intel_partitions);
+ if (rc)
+ goto out_map_destroy;
#endif
if (amd_mtd) {
rc = mtd_device_register(amd_mtd, nettel_amd_partitions,
num_amd_partitions);
+ if (rc)
+ goto out_mtd_unreg;
}
#ifdef CONFIG_MTD_CFI_INTELEXT
register_reboot_notifier(&nettel_notifier_block);
#endif
- return(rc);
+ return rc;
+out_mtd_unreg:
#ifdef CONFIG_MTD_CFI_INTELEXT
+ mtd_device_unregister(intel_mtd);
+out_map_destroy:
+ map_destroy(intel_mtd);
out_unmap1:
iounmap(nettel_intel_map.virt);
#endif
@@ -407,8 +415,7 @@ out_unmap2:
iounmap(nettel_mmcrp);
iounmap(nettel_amd_map.virt);
- return(rc);
-
+ return rc;
}
/****************************************************************************/
diff --git a/kernel/drivers/mtd/maps/pcmciamtd.c b/kernel/drivers/mtd/maps/pcmciamtd.c
index af747af5e..3dad2111b 100644
--- a/kernel/drivers/mtd/maps/pcmciamtd.c
+++ b/kernel/drivers/mtd/maps/pcmciamtd.c
@@ -700,6 +700,7 @@ static const struct pcmcia_device_id pcmciamtd_ids[] = {
PCMCIA_DEVICE_PROD_ID12("Maxtor", "MAXFL MobileMax Flash Memory Card", 0xb68968c8, 0x2dfb47b0),
PCMCIA_DEVICE_PROD_ID123("M-Systems", "M-SYS Flash Memory Card", "(c) M-Systems", 0x7ed2ad87, 0x675dc3fb, 0x7aef3965),
PCMCIA_DEVICE_PROD_ID12("PRETEC", " 2MB SRAM CARD", 0xebf91155, 0x805360ca),
+ PCMCIA_DEVICE_PROD_ID12("PRETEC", " 4MB SRAM CARD", 0xebf91155, 0x20b6bf17),
PCMCIA_DEVICE_PROD_ID12("SEIKO EPSON", "WWB101EN20", 0xf9876baf, 0xad0b207b),
PCMCIA_DEVICE_PROD_ID12("SEIKO EPSON", "WWB513EN20", 0xf9876baf, 0xe8d884ad),
PCMCIA_DEVICE_PROD_ID12("SMART Modular Technologies", " 4MB FLASH Card", 0x96fd8277, 0x737a5b05),
diff --git a/kernel/drivers/mtd/maps/physmap.c b/kernel/drivers/mtd/maps/physmap.c
index 4305fd607..cc2adbbcd 100644
--- a/kernel/drivers/mtd/maps/physmap.c
+++ b/kernel/drivers/mtd/maps/physmap.c
@@ -167,7 +167,6 @@ static int physmap_flash_probe(struct platform_device *dev)
} else {
devices_found++;
}
- info->mtd[i]->owner = THIS_MODULE;
info->mtd[i]->dev.parent = &dev->dev;
}
diff --git a/kernel/drivers/mtd/maps/physmap_of.c b/kernel/drivers/mtd/maps/physmap_of.c
index ff26e979b..e46b4e983 100644
--- a/kernel/drivers/mtd/maps/physmap_of.c
+++ b/kernel/drivers/mtd/maps/physmap_of.c
@@ -130,6 +130,8 @@ static const char * const *of_get_probes(struct device_node *dp)
count++;
res = kzalloc((count + 1)*sizeof(*res), GFP_KERNEL);
+ if (!res)
+ return NULL;
count = 0;
while (cplen > 0) {
res[count] = cp;
@@ -147,7 +149,7 @@ static void of_free_probes(const char * const *probes)
kfree(probes);
}
-static struct of_device_id of_flash_match[];
+static const struct of_device_id of_flash_match[];
static int of_flash_probe(struct platform_device *dev)
{
const char * const *part_probe_types;
@@ -288,7 +290,6 @@ static int of_flash_probe(struct platform_device *dev)
} else {
info->list_size++;
}
- info->list[i].mtd->owner = THIS_MODULE;
info->list[i].mtd->dev.parent = &dev->dev;
}
@@ -311,6 +312,10 @@ static int of_flash_probe(struct platform_device *dev)
ppdata.of_node = dp;
part_probe_types = of_get_probes(dp);
+ if (!part_probe_types) {
+ err = -ENOMEM;
+ goto err_out;
+ }
mtd_device_parse_register(info->cmtd, part_probe_types, &ppdata,
NULL, 0);
of_free_probes(part_probe_types);
@@ -327,7 +332,7 @@ err_flash_remove:
return err;
}
-static struct of_device_id of_flash_match[] = {
+static const struct of_device_id of_flash_match[] = {
{
.compatible = "cfi-flash",
.data = (void *)"cfi_probe",
diff --git a/kernel/drivers/mtd/maps/plat-ram.c b/kernel/drivers/mtd/maps/plat-ram.c
index 4b65c08d1..51572895c 100644
--- a/kernel/drivers/mtd/maps/plat-ram.c
+++ b/kernel/drivers/mtd/maps/plat-ram.c
@@ -210,7 +210,6 @@ static int platram_probe(struct platform_device *pdev)
goto exit_free;
}
- info->mtd->owner = THIS_MODULE;
info->mtd->dev.parent = &pdev->dev;
platram_setrw(info, PLATRAM_RW);
diff --git a/kernel/drivers/mtd/maps/pxa2xx-flash.c b/kernel/drivers/mtd/maps/pxa2xx-flash.c
index 12fa75df5..7497090e9 100644
--- a/kernel/drivers/mtd/maps/pxa2xx-flash.c
+++ b/kernel/drivers/mtd/maps/pxa2xx-flash.c
@@ -71,8 +71,8 @@ static int pxa2xx_flash_probe(struct platform_device *pdev)
info->map.name);
return -ENOMEM;
}
- info->map.cached =
- ioremap_cache(info->map.phys, info->map.size);
+ info->map.cached = memremap(info->map.phys, info->map.size,
+ MEMREMAP_WB);
if (!info->map.cached)
printk(KERN_WARNING "Failed to ioremap cached %s\n",
info->map.name);
@@ -93,7 +93,7 @@ static int pxa2xx_flash_probe(struct platform_device *pdev)
iounmap(info->map.cached);
return -EIO;
}
- info->mtd->owner = THIS_MODULE;
+ info->mtd->dev.parent = &pdev->dev;
mtd_device_parse_register(info->mtd, probes, NULL, flash->parts,
flash->nr_parts);
@@ -111,7 +111,7 @@ static int pxa2xx_flash_remove(struct platform_device *dev)
map_destroy(info->mtd);
iounmap(info->map.virt);
if (info->map.cached)
- iounmap(info->map.cached);
+ memunmap(info->map.cached);
kfree(info);
return 0;
}
diff --git a/kernel/drivers/mtd/maps/rbtx4939-flash.c b/kernel/drivers/mtd/maps/rbtx4939-flash.c
index 5a7551aa2..3a06ecfc5 100644
--- a/kernel/drivers/mtd/maps/rbtx4939-flash.c
+++ b/kernel/drivers/mtd/maps/rbtx4939-flash.c
@@ -96,7 +96,7 @@ static int rbtx4939_flash_probe(struct platform_device *dev)
err = -ENXIO;
goto err_out;
}
- info->mtd->owner = THIS_MODULE;
+ info->mtd->dev.parent = &dev->dev;
err = mtd_device_parse_register(info->mtd, NULL, NULL, pdata->parts,
pdata->nr_parts);
diff --git a/kernel/drivers/mtd/maps/sa1100-flash.c b/kernel/drivers/mtd/maps/sa1100-flash.c
index 892ad6ac6..142fc3d79 100644
--- a/kernel/drivers/mtd/maps/sa1100-flash.c
+++ b/kernel/drivers/mtd/maps/sa1100-flash.c
@@ -117,7 +117,6 @@ static int sa1100_probe_subdev(struct sa_subdev_info *subdev, struct resource *r
ret = -ENXIO;
goto err;
}
- subdev->mtd->owner = THIS_MODULE;
printk(KERN_INFO "SA1100 flash: CFI device at 0x%08lx, %uMiB, %d-bit\n",
phys, (unsigned)(subdev->mtd->size >> 20),
@@ -234,6 +233,7 @@ static struct sa_info *sa1100_setup_mtd(struct platform_device *pdev,
if (info->mtd == NULL)
ret = -ENXIO;
}
+ info->mtd->dev.parent = &pdev->dev;
if (ret == 0)
return info;