Commit fde3ac85 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] mtd/maps trivial annotations

NULL noise removal, missing __iomem in a couple of declarations, removal
of bogus cast to void * in iounmap() calls.
Signed-off-by: default avatarAl Viro <viro@parcelfarce.linux.theplanet.co.uk>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 64b9a359
......@@ -89,7 +89,7 @@ static int __devinit amd76xrom_init_one (struct pci_dev *pdev,
static char *rom_probe_types[] = { "cfi_probe", "jedec_probe", NULL };
u8 byte;
struct amd76xrom_window *window = &amd76xrom_window;
struct amd76xrom_map_info *map = 0;
struct amd76xrom_map_info *map = NULL;
unsigned long map_top;
/* Remember the pci dev I find the window in */
......@@ -244,7 +244,7 @@ static int __devinit amd76xrom_init_one (struct pci_dev *pdev,
map->mtd->owner = THIS_MODULE;
if (add_mtd_device(map->mtd)) {
map_destroy(map->mtd);
map->mtd = 0;
map->mtd = NULL;
goto out;
}
......@@ -254,7 +254,7 @@ static int __devinit amd76xrom_init_one (struct pci_dev *pdev,
/* File away the map structure */
list_add(&map->list, &window->maps);
map = 0;
map = NULL;
}
out:
......
......@@ -430,7 +430,7 @@ static int __init init_dnpc(void)
mymtd->erasesize = 0x10000;
if (!mymtd) {
iounmap((void *)dnpc_map.virt);
iounmap(dnpc_map.virt);
return -ENXIO;
}
......@@ -481,9 +481,9 @@ static void __exit cleanup_dnpc(void)
map_destroy(mymtd);
}
if (dnpc_map.virt) {
iounmap((void *)dnpc_map.virt);
iounmap(dnpc_map.virt);
dnpc_unmap_flash();
dnpc_map.virt = 0;
dnpc_map.virt = NULL;
}
}
......
......@@ -64,7 +64,7 @@ static struct mtd_partition ebony_large_partitions[] = {
int __init init_ebony(void)
{
u8 fpga0_reg;
u8 *fpga0_adr;
u8 __iomem *fpga0_adr;
unsigned long long small_flash_base, large_flash_base;
fpga0_adr = ioremap64(EBONY_FPGA_ADDR, 16);
......@@ -114,8 +114,7 @@ int __init init_ebony(void)
}
ebony_large_map.phys = large_flash_base;
ebony_large_map.virt =
(unsigned long)ioremap64(large_flash_base,
ebony_large_map.virt = ioremap64(large_flash_base,
ebony_large_map.size);
if (!ebony_large_map.virt) {
......@@ -146,13 +145,13 @@ static void __exit cleanup_ebony(void)
}
if (ebony_small_map.virt) {
iounmap((void *)ebony_small_map.virt);
ebony_small_map.virt = 0;
iounmap(ebony_small_map.virt);
ebony_small_map.virt = NULL;
}
if (ebony_large_map.virt) {
iounmap((void *)ebony_large_map.virt);
ebony_large_map.virt = 0;
iounmap(ebony_large_map.virt);
ebony_large_map.virt = NULL;
}
}
......
......@@ -182,7 +182,7 @@ static void cleanup_elan_104nc(void)
map_destroy( all_mtd );
}
iounmap((void *)iomapadr);
iounmap(iomapadr);
}
static int __init init_elan_104nc(void)
......
......@@ -89,7 +89,7 @@ static int __devinit ichxrom_init_one (struct pci_dev *pdev,
{
static char *rom_probe_types[] = { "cfi_probe", "jedec_probe", NULL };
struct ichxrom_window *window = &ichxrom_window;
struct ichxrom_map_info *map = 0;
struct ichxrom_map_info *map = NULL;
unsigned long map_top;
u8 byte;
u16 word;
......@@ -291,7 +291,7 @@ static int __devinit ichxrom_init_one (struct pci_dev *pdev,
map->mtd->owner = THIS_MODULE;
if (add_mtd_device(map->mtd)) {
map_destroy(map->mtd);
map->mtd = 0;
map->mtd = NULL;
goto out;
}
......@@ -301,7 +301,7 @@ static int __devinit ichxrom_init_one (struct pci_dev *pdev,
/* File away the map structure */
list_add(&map->list, &window->maps);
map = 0;
map = NULL;
}
out:
......
......@@ -103,7 +103,7 @@ static int __init init_l440gx(void)
/* Allocate the resource region */
if (pci_assign_resource(pm_dev, PIIXE_IOBASE_RESOURCE) != 0) {
printk(KERN_WARNING "Could not allocate pm iobase resource\n");
iounmap((void *)l440gx_map.virt);
iounmap(l440gx_map.virt);
return -ENXIO;
}
}
......@@ -137,7 +137,7 @@ static int __init init_l440gx(void)
return 0;
}
iounmap((void *)l440gx_map.virt);
iounmap(l440gx_map.virt);
return -ENXIO;
}
......@@ -146,7 +146,7 @@ static void __exit cleanup_l440gx(void)
del_mtd_device(mymtd);
map_destroy(mymtd);
iounmap((void *)l440gx_map.virt);
iounmap(l440gx_map.virt);
}
module_init(init_l440gx);
......
......@@ -111,7 +111,7 @@ static int __init init_netsc520(void)
mymtd = do_map_probe("map_rom", &netsc520_map);
if (!mymtd) {
iounmap((void *)netsc520_map.virt);
iounmap(netsc520_map.virt);
return -ENXIO;
}
......@@ -127,8 +127,8 @@ static void __exit cleanup_netsc520(void)
map_destroy(mymtd);
}
if (netsc520_map.virt) {
iounmap((void *)netsc520_map.virt);
netsc520_map.virt = 0;
iounmap(netsc520_map.virt);
netsc520_map.virt = NULL;
}
}
......
......@@ -471,8 +471,8 @@ void __exit nettel_cleanup(void)
map_destroy(amd_mtd);
}
if (nettel_amd_map.virt) {
iounmap((void *)nettel_amd_map.virt);
nettel_amd_map.virt = 0;
iounmap(nettel_amd_map.virt);
nettel_amd_map.virt = NULL;
}
#ifdef CONFIG_MTD_CFI_INTELEXT
if (intel_mtd) {
......
......@@ -33,7 +33,7 @@ struct mtd_pci_info {
struct map_pci_info {
struct map_info map;
void *base;
void __iomem *base;
void (*exit)(struct pci_dev *dev, struct map_pci_info *map);
unsigned long (*translate)(struct map_pci_info *map, unsigned long ofs);
struct pci_dev *dev;
......@@ -143,7 +143,7 @@ static void
intel_iq80310_exit(struct pci_dev *dev, struct map_pci_info *map)
{
if (map->base)
iounmap((void *)map->base);
iounmap(map->base);
pci_write_config_dword(dev, 0x44, map->map.map_priv_2);
}
......@@ -236,7 +236,7 @@ intel_dc21285_exit(struct pci_dev *dev, struct map_pci_info *map)
u32 val;
if (map->base)
iounmap((void *)map->base);
iounmap(map->base);
/*
* We need to undo the PCI BAR2/PCI ROM BAR address alteration.
......
......@@ -92,7 +92,7 @@ static int __init init_physmap(void)
return 0;
}
iounmap((void *)physmap_map.virt);
iounmap(physmap_map.virt);
return -ENXIO;
}
......@@ -112,8 +112,8 @@ static void __exit cleanup_physmap(void)
#endif
map_destroy(mymtd);
iounmap((void *)physmap_map.virt);
physmap_map.virt = 0;
iounmap(physmap_map.virt);
physmap_map.virt = NULL;
}
module_init(init_physmap);
......
......@@ -189,7 +189,7 @@ static void cleanup_sbc_gxx(void)
map_destroy( all_mtd );
}
iounmap((void *)iomapadr);
iounmap(iomapadr);
release_region(PAGE_IO,PAGE_IO_SIZE);
}
......@@ -206,7 +206,7 @@ static int __init init_sbc_gxx(void)
printk( KERN_ERR"%s: IO ports 0x%x-0x%x in use\n",
sbc_gxx_map.name,
PAGE_IO, PAGE_IO+PAGE_IO_SIZE-1 );
iounmap((void *)iomapadr);
iounmap(iomapadr);
return -EAGAIN;
}
......
......@@ -186,12 +186,12 @@ static struct sc520_par_table par_table[NUM_FLASH_BANKS] =
static void sc520cdp_setup_par(void)
{
volatile unsigned long *mmcr;
volatile unsigned long __iomem *mmcr;
unsigned long mmcr_val;
int i, j;
/* map in SC520's MMCR area */
mmcr = (unsigned long *)ioremap_nocache(SC520_MMCR_BASE, SC520_MMCR_EXTENT);
mmcr = ioremap_nocache(SC520_MMCR_BASE, SC520_MMCR_EXTENT);
if(!mmcr) { /* ioremap_nocache failed: skip the PAR reprogramming */
/* force physical address fields to BIOS defaults: */
for(i = 0; i < NUM_FLASH_BANKS; i++)
......@@ -223,7 +223,7 @@ static void sc520cdp_setup_par(void)
sc520cdp_map[i].phys = par_table[i].default_address;
}
}
iounmap((void *)mmcr);
iounmap(mmcr);
}
#endif
......@@ -261,7 +261,7 @@ static int __init init_sc520cdp(void)
++devices_found;
}
else {
iounmap((void *)sc520cdp_map[i].virt);
iounmap(sc520cdp_map[i].virt);
}
}
if(devices_found >= 2) {
......@@ -290,8 +290,8 @@ static void __exit cleanup_sc520cdp(void)
if (mymtd[i])
map_destroy(mymtd[i]);
if (sc520cdp_map[i].virt) {
iounmap((void *)sc520cdp_map[i].virt);
sc520cdp_map[i].virt = 0;
iounmap(sc520cdp_map[i].virt);
sc520cdp_map[i].virt = NULL;
}
}
}
......
......@@ -62,7 +62,7 @@
#define SCB2_WINDOW 0x00100000
static void *scb2_ioaddr;
static void __iomem *scb2_ioaddr;
static struct mtd_info *scb2_mtd;
static struct map_info scb2_map = {
.name = "SCB2 BIOS Flash",
......@@ -163,7 +163,7 @@ scb2_flash_probe(struct pci_dev *dev, const struct pci_device_id *ent)
}
scb2_map.phys = SCB2_ADDR;
scb2_map.virt = (void __iomem *)scb2_ioaddr;
scb2_map.virt = scb2_ioaddr;
scb2_map.size = SCB2_WINDOW;
simple_map_init(&scb2_map);
......
......@@ -190,7 +190,7 @@ static int __init init_scx200_docflash(void)
mymtd = do_map_probe(flashtype, &scx200_docflash_map);
if (!mymtd) {
printk(KERN_ERR NAME ": unable to detect flash\n");
iounmap((void *)scx200_docflash_map.virt);
iounmap(scx200_docflash_map.virt);
release_resource(&docmem);
return -ENXIO;
}
......@@ -221,7 +221,7 @@ static void __exit cleanup_scx200_docflash(void)
map_destroy(mymtd);
}
if (scx200_docflash_map.virt) {
iounmap((void *)scx200_docflash_map.virt);
iounmap(scx200_docflash_map.virt);
release_resource(&docmem);
}
}
......
......@@ -79,7 +79,7 @@ static int __init init_ts5500_map(void)
{
int rc = 0;
ts5500_map.virt = (void*)ioremap_nocache(ts5500_map.phys, ts5500_map.size);
ts5500_map.virt = ioremap_nocache(ts5500_map.phys, ts5500_map.size);
if(!ts5500_map.virt) {
printk(KERN_ERR "Failed to ioremap_nocache\n");
......@@ -110,7 +110,7 @@ static int __init init_ts5500_map(void)
err_out_map:
map_destroy(mymtd);
err_out_ioremap:
iounmap((void *)ts5500_map.virt);
iounmap(ts5500_map.virt);
return rc;
}
......@@ -127,8 +127,8 @@ static void __exit cleanup_ts5500_map(void)
}
if (ts5500_map.virt) {
iounmap((void *)ts5500_map.virt);
ts5500_map.virt = 0;
iounmap(ts5500_map.virt);
ts5500_map.virt = NULL;
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment