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