Commit 956846c2 authored by Domen Puncer's avatar Domen Puncer Committed by David Woodhouse

MTD: Remove gratuitous (void *) casts.

Signed-off-by: default avatarDomen Puncer <domen@coderock.org>
Signed-off-by: default avatarDavid Woodhouse <dwmw2@infradead.org>
parent 6f509355
......@@ -11,7 +11,7 @@
* not going to guess how to send commands to them, plus I expect they will
* all speak CFI..
*
* $Id: jedec.c,v 1.21 2004/08/09 13:19:43 dwmw2 Exp $
* $Id: jedec.c,v 1.22 2005/01/05 18:05:11 dwmw2 Exp $
*/
#include <linux/init.h>
......@@ -529,7 +529,7 @@ static int jedec_probe32(struct map_info *map,unsigned long base,
static int jedec_read(struct mtd_info *mtd, loff_t from, size_t len,
size_t *retlen, u_char *buf)
{
struct map_info *map = (struct map_info *)mtd->priv;
struct map_info *map = mtd->priv;
map_copy_from(map, buf, from, len);
*retlen = len;
......@@ -541,8 +541,8 @@ static int jedec_read(struct mtd_info *mtd, loff_t from, size_t len,
static int jedec_read_banked(struct mtd_info *mtd, loff_t from, size_t len,
size_t *retlen, u_char *buf)
{
struct map_info *map = (struct map_info *)mtd->priv;
struct jedec_private *priv = (struct jedec_private *)map->fldrv_priv;
struct map_info *map = mtd->priv;
struct jedec_private *priv = map->fldrv_priv;
*retlen = 0;
while (len > 0)
......@@ -593,8 +593,8 @@ static int flash_erase(struct mtd_info *mtd, struct erase_info *instr)
unsigned long NoTime = 0;
unsigned long start = instr->addr, len = instr->len;
unsigned int I;
struct map_info *map = (struct map_info *)mtd->priv;
struct jedec_private *priv = (struct jedec_private *)map->fldrv_priv;
struct map_info *map = mtd->priv;
struct jedec_private *priv = map->fldrv_priv;
// Verify the arguments..
if (start + len > mtd->size ||
......@@ -800,8 +800,8 @@ static int flash_write(struct mtd_info *mtd, loff_t start, size_t len,
#define flread(x) map_read8(map,base+(off&((1<<chip->addrshift)-1))+((x)<<chip->addrshift))
#define flwrite(v,x) map_write8(map,v,base+(off&((1<<chip->addrshift)-1))+((x)<<chip->addrshift))
struct map_info *map = (struct map_info *)mtd->priv;
struct jedec_private *priv = (struct jedec_private *)map->fldrv_priv;
struct map_info *map = mtd->priv;
struct jedec_private *priv = map->fldrv_priv;
unsigned long base;
unsigned long off;
size_t save_len = len;
......
/*
* Common code to handle map devices which are simple RAM
* (C) 2000 Red Hat. GPL'd.
* $Id: map_ram.c,v 1.21 2004/11/16 18:29:00 dwmw2 Exp $
* $Id: map_ram.c,v 1.22 2005/01/05 18:05:12 dwmw2 Exp $
*/
#include <linux/module.h>
......@@ -83,7 +83,7 @@ static struct mtd_info *map_ram_probe(struct map_info *map)
static int mapram_read (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf)
{
struct map_info *map = (struct map_info *)mtd->priv;
struct map_info *map = mtd->priv;
map_copy_from(map, buf, from, len);
*retlen = len;
......@@ -92,7 +92,7 @@ static int mapram_read (struct mtd_info *mtd, loff_t from, size_t len, size_t *r
static int mapram_write (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf)
{
struct map_info *map = (struct map_info *)mtd->priv;
struct map_info *map = mtd->priv;
map_copy_to(map, to, buf, len);
*retlen = len;
......@@ -103,7 +103,7 @@ static int mapram_erase (struct mtd_info *mtd, struct erase_info *instr)
{
/* Yeah, it's inefficient. Who cares? It's faster than a _real_
flash erase. */
struct map_info *map = (struct map_info *)mtd->priv;
struct map_info *map = mtd->priv;
map_word allff;
unsigned long i;
......
/*
* Common code to handle map devices which are simple ROM
* (C) 2000 Red Hat. GPL'd.
* $Id: map_rom.c,v 1.22 2004/11/16 18:29:00 dwmw2 Exp $
* $Id: map_rom.c,v 1.23 2005/01/05 18:05:12 dwmw2 Exp $
*/
#include <linux/module.h>
......@@ -57,7 +57,7 @@ static struct mtd_info *map_rom_probe(struct map_info *map)
static int maprom_read (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf)
{
struct map_info *map = (struct map_info *)mtd->priv;
struct map_info *map = mtd->priv;
map_copy_from(map, buf, from, len);
*retlen = len;
......
......@@ -4,7 +4,7 @@
* (c) 1999 Machine Vision Holdings, Inc.
* (c) 1999, 2000 David Woodhouse <dwmw2@infradead.org>
*
* $Id: doc2000.c,v 1.65 2005/01/05 12:40:36 dwmw2 Exp $
* $Id: doc2000.c,v 1.66 2005/01/05 18:05:12 dwmw2 Exp $
*/
#include <linux/kernel.h>
......@@ -527,14 +527,14 @@ static const char im_name[] = "DoC2k_init";
*/
static void DoC2k_init(struct mtd_info *mtd)
{
struct DiskOnChip *this = (struct DiskOnChip *) mtd->priv;
struct DiskOnChip *this = mtd->priv;
struct DiskOnChip *old = NULL;
int maxchips;
/* We must avoid being called twice for the same device. */
if (doc2klist)
old = (struct DiskOnChip *) doc2klist->priv;
old = doc2klist->priv;
while (old) {
if (DoC2k_is_alias(old, this)) {
......@@ -546,7 +546,7 @@ static void DoC2k_init(struct mtd_info *mtd)
return;
}
if (old->nextdoc)
old = (struct DiskOnChip *) old->nextdoc->priv;
old = old->nextdoc->priv;
else
old = NULL;
}
......@@ -633,7 +633,7 @@ static int doc_read(struct mtd_info *mtd, loff_t from, size_t len,
static int doc_read_ecc(struct mtd_info *mtd, loff_t from, size_t len,
size_t * retlen, u_char * buf, u_char * eccbuf, struct nand_oobinfo *oobsel)
{
struct DiskOnChip *this = (struct DiskOnChip *) mtd->priv;
struct DiskOnChip *this = mtd->priv;
void __iomem *docptr = this->virtadr;
struct Nand *mychip;
unsigned char syndrome[6];
......@@ -790,7 +790,7 @@ static int doc_write_ecc(struct mtd_info *mtd, loff_t to, size_t len,
size_t * retlen, const u_char * buf,
u_char * eccbuf, struct nand_oobinfo *oobsel)
{
struct DiskOnChip *this = (struct DiskOnChip *) mtd->priv;
struct DiskOnChip *this = mtd->priv;
int di; /* Yes, DI is a hangover from when I was disassembling the binary driver */
void __iomem *docptr = this->virtadr;
volatile char dummy;
......@@ -1033,7 +1033,7 @@ static int doc_writev_ecc(struct mtd_info *mtd, const struct kvec *vecs,
static int doc_read_oob(struct mtd_info *mtd, loff_t ofs, size_t len,
size_t * retlen, u_char * buf)
{
struct DiskOnChip *this = (struct DiskOnChip *) mtd->priv;
struct DiskOnChip *this = mtd->priv;
int len256 = 0, ret;
struct Nand *mychip;
......@@ -1091,7 +1091,7 @@ static int doc_read_oob(struct mtd_info *mtd, loff_t ofs, size_t len,
static int doc_write_oob_nolock(struct mtd_info *mtd, loff_t ofs, size_t len,
size_t * retlen, const u_char * buf)
{
struct DiskOnChip *this = (struct DiskOnChip *) mtd->priv;
struct DiskOnChip *this = mtd->priv;
int len256 = 0;
void __iomem *docptr = this->virtadr;
struct Nand *mychip = &this->chips[ofs >> this->chipshift];
......@@ -1194,7 +1194,7 @@ static int doc_write_oob_nolock(struct mtd_info *mtd, loff_t ofs, size_t len,
static int doc_write_oob(struct mtd_info *mtd, loff_t ofs, size_t len,
size_t * retlen, const u_char * buf)
{
struct DiskOnChip *this = (struct DiskOnChip *) mtd->priv;
struct DiskOnChip *this = mtd->priv;
int ret;
down(&this->lock);
......@@ -1206,7 +1206,7 @@ static int doc_write_oob(struct mtd_info *mtd, loff_t ofs, size_t len,
static int doc_erase(struct mtd_info *mtd, struct erase_info *instr)
{
struct DiskOnChip *this = (struct DiskOnChip *) mtd->priv;
struct DiskOnChip *this = mtd->priv;
__u32 ofs = instr->addr;
__u32 len = instr->len;
volatile int dummy;
......@@ -1288,7 +1288,7 @@ static void __exit cleanup_doc2000(void)
struct DiskOnChip *this;
while ((mtd = doc2klist)) {
this = (struct DiskOnChip *) mtd->priv;
this = mtd->priv;
doc2klist = this->nextdoc;
del_mtd_device(mtd);
......
......@@ -4,7 +4,7 @@
* (c) 1999 Machine Vision Holdings, Inc.
* (c) 1999, 2000 David Woodhouse <dwmw2@infradead.org>
*
* $Id: doc2001.c,v 1.47 2005/01/05 12:40:36 dwmw2 Exp $
* $Id: doc2001.c,v 1.48 2005/01/05 18:05:12 dwmw2 Exp $
*/
#include <linux/kernel.h>
......@@ -335,12 +335,12 @@ static const char im_name[] = "DoCMil_init";
*/
static void DoCMil_init(struct mtd_info *mtd)
{
struct DiskOnChip *this = (struct DiskOnChip *)mtd->priv;
struct DiskOnChip *this = mtd->priv;
struct DiskOnChip *old = NULL;
/* We must avoid being called twice for the same device. */
if (docmillist)
old = (struct DiskOnChip *)docmillist->priv;
old = docmillist->priv;
while (old) {
if (DoCMil_is_alias(this, old)) {
......@@ -351,7 +351,7 @@ static void DoCMil_init(struct mtd_info *mtd)
return;
}
if (old->nextdoc)
old = (struct DiskOnChip *)old->nextdoc->priv;
old = old->nextdoc->priv;
else
old = NULL;
}
......@@ -416,7 +416,7 @@ static int doc_read_ecc (struct mtd_info *mtd, loff_t from, size_t len,
int i, ret;
volatile char dummy;
unsigned char syndrome[6];
struct DiskOnChip *this = (struct DiskOnChip *)mtd->priv;
struct DiskOnChip *this = mtd->priv;
void __iomem *docptr = this->virtadr;
struct Nand *mychip = &this->chips[from >> (this->chipshift)];
......@@ -542,7 +542,7 @@ static int doc_write_ecc (struct mtd_info *mtd, loff_t to, size_t len,
{
int i,ret = 0;
volatile char dummy;
struct DiskOnChip *this = (struct DiskOnChip *)mtd->priv;
struct DiskOnChip *this = mtd->priv;
void __iomem *docptr = this->virtadr;
struct Nand *mychip = &this->chips[to >> (this->chipshift)];
......@@ -677,7 +677,7 @@ static int doc_read_oob(struct mtd_info *mtd, loff_t ofs, size_t len,
int i;
#endif
volatile char dummy;
struct DiskOnChip *this = (struct DiskOnChip *)mtd->priv;
struct DiskOnChip *this = mtd->priv;
void __iomem *docptr = this->virtadr;
struct Nand *mychip = &this->chips[ofs >> this->chipshift];
......@@ -729,7 +729,7 @@ static int doc_write_oob(struct mtd_info *mtd, loff_t ofs, size_t len,
#endif
volatile char dummy;
int ret = 0;
struct DiskOnChip *this = (struct DiskOnChip *)mtd->priv;
struct DiskOnChip *this = mtd->priv;
void __iomem *docptr = this->virtadr;
struct Nand *mychip = &this->chips[ofs >> this->chipshift];
......@@ -796,7 +796,7 @@ static int doc_write_oob(struct mtd_info *mtd, loff_t ofs, size_t len,
int doc_erase (struct mtd_info *mtd, struct erase_info *instr)
{
volatile char dummy;
struct DiskOnChip *this = (struct DiskOnChip *)mtd->priv;
struct DiskOnChip *this = mtd->priv;
__u32 ofs = instr->addr;
__u32 len = instr->len;
void __iomem *docptr = this->virtadr;
......@@ -868,7 +868,7 @@ static void __exit cleanup_doc2001(void)
struct DiskOnChip *this;
while ((mtd=docmillist)) {
this = (struct DiskOnChip *)mtd->priv;
this = mtd->priv;
docmillist = this->nextdoc;
del_mtd_device(mtd);
......
......@@ -6,7 +6,7 @@
* (c) 1999 Machine Vision Holdings, Inc.
* (c) 1999, 2000 David Woodhouse <dwmw2@infradead.org>
*
* $Id: doc2001plus.c,v 1.12 2005/01/05 12:40:36 dwmw2 Exp $
* $Id: doc2001plus.c,v 1.13 2005/01/05 18:05:12 dwmw2 Exp $
*
* Released under GPL
*/
......@@ -190,7 +190,7 @@ static int DoC_SelectFloor(void __iomem * docptr, int floor)
may not want it */
static unsigned int DoC_GetDataOffset(struct mtd_info *mtd, loff_t *from)
{
struct DiskOnChip *this = (struct DiskOnChip *)mtd->priv;
struct DiskOnChip *this = mtd->priv;
if (this->interleave) {
unsigned int ofs = *from & 0x3ff;
......@@ -458,12 +458,12 @@ static const char im_name[] = "DoCMilPlus_init";
*/
static void DoCMilPlus_init(struct mtd_info *mtd)
{
struct DiskOnChip *this = (struct DiskOnChip *)mtd->priv;
struct DiskOnChip *this = mtd->priv;
struct DiskOnChip *old = NULL;
/* We must avoid being called twice for the same device. */
if (docmilpluslist)
old = (struct DiskOnChip *)docmilpluslist->priv;
old = docmilpluslist->priv;
while (old) {
if (DoCMilPlus_is_alias(this, old)) {
......@@ -475,7 +475,7 @@ static void DoCMilPlus_init(struct mtd_info *mtd)
return;
}
if (old->nextdoc)
old = (struct DiskOnChip *)old->nextdoc->priv;
old = old->nextdoc->priv;
else
old = NULL;
}
......@@ -530,7 +530,7 @@ static int doc_dumpblk(struct mtd_info *mtd, loff_t from)
{
int i;
loff_t fofs;
struct DiskOnChip *this = (struct DiskOnChip *)mtd->priv;
struct DiskOnChip *this = mtd->priv;
void __iomem * docptr = this->virtadr;
struct Nand *mychip = &this->chips[from >> (this->chipshift)];
unsigned char *bp, buf[1056];
......@@ -615,7 +615,7 @@ static int doc_read_ecc(struct mtd_info *mtd, loff_t from, size_t len,
volatile char dummy;
loff_t fofs;
unsigned char syndrome[6];
struct DiskOnChip *this = (struct DiskOnChip *)mtd->priv;
struct DiskOnChip *this = mtd->priv;
void __iomem * docptr = this->virtadr;
struct Nand *mychip = &this->chips[from >> (this->chipshift)];
......@@ -754,7 +754,7 @@ static int doc_write_ecc(struct mtd_info *mtd, loff_t to, size_t len,
int i, before, ret = 0;
loff_t fto;
volatile char dummy;
struct DiskOnChip *this = (struct DiskOnChip *)mtd->priv;
struct DiskOnChip *this = mtd->priv;
void __iomem * docptr = this->virtadr;
struct Nand *mychip = &this->chips[to >> (this->chipshift)];
......@@ -880,7 +880,7 @@ static int doc_read_oob(struct mtd_info *mtd, loff_t ofs, size_t len,
size_t *retlen, u_char *buf)
{
loff_t fofs, base;
struct DiskOnChip *this = (struct DiskOnChip *)mtd->priv;
struct DiskOnChip *this = mtd->priv;
void __iomem * docptr = this->virtadr;
struct Nand *mychip = &this->chips[ofs >> this->chipshift];
size_t i, size, got, want;
......@@ -958,7 +958,7 @@ static int doc_write_oob(struct mtd_info *mtd, loff_t ofs, size_t len,
{
volatile char dummy;
loff_t fofs, base;
struct DiskOnChip *this = (struct DiskOnChip *)mtd->priv;
struct DiskOnChip *this = mtd->priv;
void __iomem * docptr = this->virtadr;
struct Nand *mychip = &this->chips[ofs >> this->chipshift];
size_t i, size, got, want;
......@@ -1058,7 +1058,7 @@ static int doc_write_oob(struct mtd_info *mtd, loff_t ofs, size_t len,
int doc_erase(struct mtd_info *mtd, struct erase_info *instr)
{
volatile char dummy;
struct DiskOnChip *this = (struct DiskOnChip *)mtd->priv;
struct DiskOnChip *this = mtd->priv;
__u32 ofs = instr->addr;
__u32 len = instr->len;
void __iomem * docptr = this->virtadr;
......@@ -1134,7 +1134,7 @@ static void __exit cleanup_doc2001plus(void)
struct DiskOnChip *this;
while ((mtd=docmilpluslist)) {
this = (struct DiskOnChip *)mtd->priv;
this = mtd->priv;
docmilpluslist = this->nextdoc;
del_mtd_device(mtd);
......
......@@ -6,7 +6,7 @@
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* $Id: ms02-nv.c,v 1.7 2004/07/29 14:16:45 macro Exp $
* $Id: ms02-nv.c,v 1.8 2005/01/05 18:05:12 dwmw2 Exp $
*/
#include <linux/init.h>
......@@ -59,7 +59,7 @@ static struct mtd_info *root_ms02nv_mtd;
static int ms02nv_read(struct mtd_info *mtd, loff_t from,
size_t len, size_t *retlen, u_char *buf)
{
struct ms02nv_private *mp = (struct ms02nv_private *)mtd->priv;
struct ms02nv_private *mp = mtd->priv;
if (from + len > mtd->size)
return -EINVAL;
......@@ -73,7 +73,7 @@ static int ms02nv_read(struct mtd_info *mtd, loff_t from,
static int ms02nv_write(struct mtd_info *mtd, loff_t to,
size_t len, size_t *retlen, const u_char *buf)
{
struct ms02nv_private *mp = (struct ms02nv_private *)mtd->priv;
struct ms02nv_private *mp = mtd->priv;
if (to + len > mtd->size)
return -EINVAL;
......@@ -265,7 +265,7 @@ static int __init ms02nv_init_one(ulong addr)
static void __exit ms02nv_remove_one(void)
{
struct mtd_info *mtd = root_ms02nv_mtd;
struct ms02nv_private *mp = (struct ms02nv_private *)mtd->priv;
struct ms02nv_private *mp = mtd->priv;
root_ms02nv_mtd = mp->next;
......
/*
* mtdram - a test mtd device
* $Id: mtdram.c,v 1.34 2004/11/16 18:29:01 dwmw2 Exp $
* $Id: mtdram.c,v 1.35 2005/01/05 18:05:12 dwmw2 Exp $
* Author: Alexander Larsson <alex@cendio.se>
*
* Copyright (c) 1999 Alexander Larsson <alex@cendio.se>
......@@ -158,7 +158,7 @@ static int __init init_mtdram(void)
void *addr;
int err;
/* Allocate some memory */
mtd_info = (struct mtd_info *)kmalloc(sizeof(struct mtd_info), GFP_KERNEL);
mtd_info = kmalloc(sizeof(struct mtd_info), GFP_KERNEL);
if (!mtd_info)
return -ENOMEM;
......@@ -191,7 +191,7 @@ static int __init init_mtdram(void)
void *addr;
int err;
/* Allocate some memory */
mtd_info = (struct mtd_info *)kmalloc(sizeof(struct mtd_info), GFP_KERNEL);
mtd_info = kmalloc(sizeof(struct mtd_info), GFP_KERNEL);
if (!mtd_info)
return -ENOMEM;
......
/**
* $Id: phram.c,v 1.10 2004/12/10 17:53:13 joern Exp $
* $Id: phram.c,v 1.11 2005/01/05 18:05:13 dwmw2 Exp $
*
* Copyright (c) ???? Jochen Schuble <psionic@psionic.de>
* Copyright (c) 2003-2004 Jrn Engel <joern@wh.fh-wedel.de>
......@@ -39,7 +39,7 @@ static LIST_HEAD(phram_list);
static int phram_erase(struct mtd_info *mtd, struct erase_info *instr)
{
u_char *start = (u_char *)mtd->priv;
u_char *start = mtd->priv;
if (instr->addr + instr->len > mtd->size)
return -EINVAL;
......@@ -61,7 +61,7 @@ static int phram_erase(struct mtd_info *mtd, struct erase_info *instr)
static int phram_point(struct mtd_info *mtd, loff_t from, size_t len,
size_t *retlen, u_char **mtdbuf)
{
u_char *start = (u_char *)mtd->priv;
u_char *start = mtd->priv;
if (from + len > mtd->size)
return -EINVAL;
......@@ -78,7 +78,7 @@ static void phram_unpoint(struct mtd_info *mtd, u_char *addr, loff_t from, size_
static int phram_read(struct mtd_info *mtd, loff_t from, size_t len,
size_t *retlen, u_char *buf)
{
u_char *start = (u_char *)mtd->priv;
u_char *start = mtd->priv;
if (from + len > mtd->size)
return -EINVAL;
......@@ -92,7 +92,7 @@ static int phram_read(struct mtd_info *mtd, loff_t from, size_t len,
static int phram_write(struct mtd_info *mtd, loff_t to, size_t len,
size_t *retlen, const u_char *buf)
{
u_char *start = (u_char *)mtd->priv;
u_char *start = mtd->priv;
if (to + len > mtd->size)
return -EINVAL;
......
/*
* $Id: pmc551.c,v 1.29 2004/11/16 18:29:01 dwmw2 Exp $
* $Id: pmc551.c,v 1.30 2005/01/05 18:05:13 dwmw2 Exp $
*
* PMC551 PCI Mezzanine Ram Device
*
......@@ -113,7 +113,7 @@ static struct mtd_info *pmc551list;
static int pmc551_erase (struct mtd_info *mtd, struct erase_info *instr)
{
struct mypriv *priv = (struct mypriv *)mtd->priv;
struct mypriv *priv = mtd->priv;
u32 soff_hi, soff_lo; /* start address offset hi/lo */
u32 eoff_hi, eoff_lo; /* end address offset hi/lo */
unsigned long end;
......@@ -176,7 +176,7 @@ static int pmc551_erase (struct mtd_info *mtd, struct erase_info *instr)
static int pmc551_point (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char **mtdbuf)
{
struct mypriv *priv = (struct mypriv *)mtd->priv;
struct mypriv *priv = mtd->priv;
u32 soff_hi;
u32 soff_lo;
......@@ -217,7 +217,7 @@ static void pmc551_unpoint (struct mtd_info *mtd, u_char *addr, loff_t from, siz
static int pmc551_read (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf)
{
struct mypriv *priv = (struct mypriv *)mtd->priv;
struct mypriv *priv = mtd->priv;
u32 soff_hi, soff_lo; /* start address offset hi/lo */
u32 eoff_hi, eoff_lo; /* end address offset hi/lo */
unsigned long end;
......@@ -279,7 +279,7 @@ static int pmc551_read (struct mtd_info *mtd, loff_t from, size_t len, size_t *r
static int pmc551_write (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf)
{
struct mypriv *priv = (struct mypriv *)mtd->priv;
struct mypriv *priv = mtd->priv;
u32 soff_hi, soff_lo; /* start address offset hi/lo */
u32 eoff_hi, eoff_lo; /* end address offset hi/lo */
unsigned long end;
......@@ -820,7 +820,7 @@ static void __exit cleanup_pmc551(void)
struct mypriv *priv;
while((mtd=pmc551list)) {
priv = (struct mypriv *)mtd->priv;
priv = mtd->priv;
pmc551list = priv->nextpmc551;
if(priv->start) {
......
/*======================================================================
$Id: slram.c,v 1.32 2004/11/16 18:29:01 dwmw2 Exp $
$Id: slram.c,v 1.33 2005/01/05 18:05:13 dwmw2 Exp $
This driver provides a method to access memory not used by the kernel
itself (i.e. if the kernel commandline mem=xxx is used). To actually
......@@ -106,7 +106,7 @@ static int slram_erase(struct mtd_info *mtd, struct erase_info *instr)
static int slram_point(struct mtd_info *mtd, loff_t from, size_t len,
size_t *retlen, u_char **mtdbuf)
{
slram_priv_t *priv = (slram_priv_t *)mtd->priv;
slram_priv_t *priv = mtd->priv;
*mtdbuf = priv->start + from;
*retlen = len;
......@@ -120,7 +120,7 @@ static void slram_unpoint(struct mtd_info *mtd, u_char *addr, loff_t from, size_
static int slram_read(struct mtd_info *mtd, loff_t from, size_t len,
size_t *retlen, u_char *buf)
{
slram_priv_t *priv = (slram_priv_t *)mtd->priv;
slram_priv_t *priv = mtd->priv;
memcpy(buf, priv->start + from, len);
......@@ -131,7 +131,7 @@ static int slram_read(struct mtd_info *mtd, loff_t from, size_t len,
static int slram_write(struct mtd_info *mtd, loff_t to, size_t len,
size_t *retlen, const u_char *buf)
{
slram_priv_t *priv = (slram_priv_t *)mtd->priv;
slram_priv_t *priv = mtd->priv;
memcpy(priv->start + to, buf, len);
......@@ -161,7 +161,7 @@ static int register_device(char *name, unsigned long start, unsigned long length
if ((*curmtd)->mtdinfo) {
memset((char *)(*curmtd)->mtdinfo, 0, sizeof(struct mtd_info));
(*curmtd)->mtdinfo->priv =
(void *)kmalloc(sizeof(slram_priv_t), GFP_KERNEL);
kmalloc(sizeof(slram_priv_t), GFP_KERNEL);
if (!(*curmtd)->mtdinfo->priv) {
kfree((*curmtd)->mtdinfo);
......
/*
* $Id: ocelot.c,v 1.15 2004/11/04 13:24:15 gleixner Exp $
* $Id: ocelot.c,v 1.16 2005/01/05 18:05:13 dwmw2 Exp $
*
* Flash on Momenco Ocelot
*/
......@@ -28,7 +28,7 @@ static struct mtd_info *nvram_mtd;
static void ocelot_ram_write(struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf)
{
struct map_info *map = (struct map_info *)mtd->priv;
struct map_info *map = mtd->priv;
size_t done = 0;
/* If we use memcpy, it does word-wide writes. Even though we told the
......
......@@ -5,7 +5,7 @@
*
* (C) Copyright 2002, Greg Ungerer (gerg@snapgear.com)
*
* $Id: uclinux.c,v 1.9 2004/11/04 13:24:15 gleixner Exp $
* $Id: uclinux.c,v 1.10 2005/01/05 18:05:13 dwmw2 Exp $
*/
/****************************************************************************/
......@@ -47,7 +47,7 @@ struct mtd_partition uclinux_romfs[] = {
int uclinux_point(struct mtd_info *mtd, loff_t from, size_t len,
size_t *retlen, u_char **mtdbuf)
{
struct map_info *map = (struct map_info *) mtd->priv;
struct map_info *map = mtd->priv;
*mtdbuf = (u_char *) (map->virt + ((int) from));
*retlen = len;
return(0);
......@@ -81,7 +81,7 @@ int __init uclinux_mtd_init(void)
mtd = do_map_probe("map_ram", mapp);
if (!mtd) {
printk("uclinux[mtd]: failed to find a mapping?\n");
iounmap((void *) mapp->virt);
iounmap(mapp->virt);
return(-ENXIO);
}
......
/*
* $Id: mtdchar.c,v 1.65 2004/09/23 23:45:47 gleixner Exp $
* $Id: mtdchar.c,v 1.66 2005/01/05 18:05:11 dwmw2 Exp $
*
* Character-device access to raw MTD devices.
*
......@@ -61,7 +61,7 @@ static inline void mtdchar_devfs_exit(void)
static loff_t mtd_lseek (struct file *file, loff_t offset, int orig)
{
struct mtd_info *mtd=(struct mtd_info *)file->private_data;
struct mtd_info *mtd = file->private_data;
switch (orig) {
case 0:
......@@ -134,7 +134,7 @@ static int mtd_close(struct inode *inode, struct file *file)
DEBUG(MTD_DEBUG_LEVEL0, "MTD_close\n");
mtd = (struct mtd_info *)file->private_data;
mtd = file->private_data;
if (mtd->sync)
mtd->sync(mtd);
......@@ -151,7 +151,7 @@ static int mtd_close(struct inode *inode, struct file *file)
static ssize_t mtd_read(struct file *file, char __user *buf, size_t count,loff_t *ppos)
{
struct mtd_info *mtd = (struct mtd_info *)file->private_data;
struct mtd_info *mtd = file->private_data;
size_t retlen=0;
size_t total_retlen=0;
int ret=0;
......@@ -210,7 +210,7 @@ static ssize_t mtd_read(struct file *file, char __user *buf, size_t count,loff_t
static ssize_t mtd_write(struct file *file, const char __user *buf, size_t count,loff_t *ppos)
{
struct mtd_info *mtd = (struct mtd_info *)file->private_data;
struct mtd_info *mtd = file->private_data;
char *kbuf;
size_t retlen;
size_t total_retlen=0;
......@@ -276,7 +276,7 @@ static void mtdchar_erase_callback (struct erase_info *instr)
static int mtd_ioctl(struct inode *inode, struct file *file,
u_int cmd, u_long arg)
{
struct mtd_info *mtd = (struct mtd_info *)file->private_data;
struct mtd_info *mtd = file->private_data;
void __user *argp = (void __user *)arg;
int ret = 0;
u_long size;
......
......@@ -16,7 +16,7 @@
*
* Interface to generic NAND code for M-Systems DiskOnChip devices
*
* $Id: diskonchip.c,v 1.44 2005/01/05 17:34:27 dwmw2 Exp $
* $Id: diskonchip.c,v 1.45 2005/01/05 18:05:14 dwmw2 Exp $
*/
#include <linux/kernel.h>
......@@ -309,7 +309,7 @@ static inline int DoC_WaitReady(struct doc_priv *doc)
static void doc2000_write_byte(struct mtd_info *mtd, u_char datum)
{
struct nand_chip *this = mtd->priv;
struct doc_priv *doc = (void *)this->priv;
struct doc_priv *doc = this->priv;
void __iomem *docptr = doc->virtadr;
if(debug)printk("write_byte %02x\n", datum);
......@@ -320,7 +320,7 @@ static void doc2000_write_byte(struct mtd_info *mtd, u_char datum)
static u_char doc2000_read_byte(struct mtd_info *mtd)
{
struct nand_chip *this = mtd->priv;
struct doc_priv *doc = (void *)this->priv;
struct doc_priv *doc = this->priv;
void __iomem *docptr = doc->virtadr;
u_char ret;
......@@ -335,7 +335,7 @@ static void doc2000_writebuf(struct mtd_info *mtd,
const u_char *buf, int len)
{
struct nand_chip *this = mtd->priv;
struct doc_priv *doc = (void *)this->priv;
struct doc_priv *doc = this->priv;
void __iomem *docptr = doc->virtadr;
int i;
if (debug)printk("writebuf of %d bytes: ", len);
......@@ -351,7 +351,7 @@ static void doc2000_readbuf(struct mtd_info *mtd,
u_char *buf, int len)
{
struct nand_chip *this = mtd->priv;
struct doc_priv *doc = (void *)this->priv;
struct doc_priv *doc = this->priv;
void __iomem *docptr = doc->virtadr;
int i;
......@@ -366,7 +366,7 @@ static void doc2000_readbuf_dword(struct mtd_info *mtd,
u_char *buf, int len)
{
struct nand_chip *this = mtd->priv;
struct doc_priv *doc = (void *)this->priv;
struct doc_priv *doc = this->priv;
void __iomem *docptr = doc->virtadr;
int i;
......@@ -387,7 +387,7 @@ static int doc2000_verifybuf(struct mtd_info *mtd,
const u_char *buf, int len)
{
struct nand_chip *this = mtd->priv;
struct doc_priv *doc = (void *)this->priv;
struct doc_priv *doc = this->priv;
void __iomem *docptr = doc->virtadr;
int i;
......@@ -400,7 +400,7 @@ static int doc2000_verifybuf(struct mtd_info *mtd,
static uint16_t __init doc200x_ident_chip(struct mtd_info *mtd, int nr)
{
struct nand_chip *this = mtd->priv;
struct doc_priv *doc = (void *)this->priv;
struct doc_priv *doc = this->priv;
uint16_t ret;
doc200x_select_chip(mtd, nr);
......@@ -442,7 +442,7 @@ static uint16_t __init doc200x_ident_chip(struct mtd_info *mtd, int nr)
static void __init doc2000_count_chips(struct mtd_info *mtd)
{
struct nand_chip *this = mtd->priv;
struct doc_priv *doc = (void *)this->priv;
struct doc_priv *doc = this->priv;
uint16_t mfrid;
int i;
......@@ -463,7 +463,7 @@ static void __init doc2000_count_chips(struct mtd_info *mtd)
static int doc200x_wait(struct mtd_info *mtd, struct nand_chip *this, int state)
{
struct doc_priv *doc = (void *)this->priv;
struct doc_priv *doc = this->priv;
int status;
......@@ -478,7 +478,7 @@ static int doc200x_wait(struct mtd_info *mtd, struct nand_chip *this, int state)
static void doc2001_write_byte(struct mtd_info *mtd, u_char datum)
{
struct nand_chip *this = mtd->priv;
struct doc_priv *doc = (void *)this->priv;
struct doc_priv *doc = this->priv;
void __iomem *docptr = doc->virtadr;
WriteDOC(datum, docptr, CDSNSlowIO);
......@@ -489,7 +489,7 @@ static void doc2001_write_byte(struct mtd_info *mtd, u_char datum)
static u_char doc2001_read_byte(struct mtd_info *mtd)
{
struct nand_chip *this = mtd->priv;
struct doc_priv *doc = (void *)this->priv;
struct doc_priv *doc = this->priv;
void __iomem *docptr = doc->virtadr;
//ReadDOC(docptr, CDSNSlowIO);
......@@ -504,7 +504,7 @@ static void doc2001_writebuf(struct mtd_info *mtd,
const u_char *buf, int len)
{
struct nand_chip *this = mtd->priv;
struct doc_priv *doc = (void *)this->priv;
struct doc_priv *doc = this->priv;
void __iomem *docptr = doc->virtadr;
int i;
......@@ -518,7 +518,7 @@ static void doc2001_readbuf(struct mtd_info *mtd,
u_char *buf, int len)
{
struct nand_chip *this = mtd->priv;
struct doc_priv *doc = (void *)this->priv;
struct doc_priv *doc = this->priv;
void __iomem *docptr = doc->virtadr;
int i;
......@@ -536,7 +536,7 @@ static int doc2001_verifybuf(struct mtd_info *mtd,
const u_char *buf, int len)
{
struct nand_chip *this = mtd->priv;
struct doc_priv *doc = (void *)this->priv;
struct doc_priv *doc = this->priv;
void __iomem *docptr = doc->virtadr;
int i;
......@@ -556,7 +556,7 @@ static int doc2001_verifybuf(struct mtd_info *mtd,
static u_char doc2001plus_read_byte(struct mtd_info *mtd)
{
struct nand_chip *this = mtd->priv;
struct doc_priv *doc = (void *)this->priv;
struct doc_priv *doc = this->priv;
void __iomem *docptr = doc->virtadr;
u_char ret;
......@@ -571,7 +571,7 @@ static void doc2001plus_writebuf(struct mtd_info *mtd,
const u_char *buf, int len)
{
struct nand_chip *this = mtd->priv;
struct doc_priv *doc = (void *)this->priv;
struct doc_priv *doc = this->priv;
void __iomem *docptr = doc->virtadr;
int i;
......@@ -588,7 +588,7 @@ static void doc2001plus_readbuf(struct mtd_info *mtd,
u_char *buf, int len)
{
struct nand_chip *this = mtd->priv;
struct doc_priv *doc = (void *)this->priv;
struct doc_priv *doc = this->priv;
void __iomem *docptr = doc->virtadr;
int i;
......@@ -618,7 +618,7 @@ static int doc2001plus_verifybuf(struct mtd_info *mtd,
const u_char *buf, int len)
{
struct nand_chip *this = mtd->priv;
struct doc_priv *doc = (void *)this->priv;
struct doc_priv *doc = this->priv;
void __iomem *docptr = doc->virtadr;
int i;
......@@ -644,7 +644,7 @@ static int doc2001plus_verifybuf(struct mtd_info *mtd,
static void doc2001plus_select_chip(struct mtd_info *mtd, int chip)
{
struct nand_chip *this = mtd->priv;
struct doc_priv *doc = (void *)this->priv;
struct doc_priv *doc = this->priv;
void __iomem *docptr = doc->virtadr;
int floor = 0;
......@@ -670,7 +670,7 @@ static void doc2001plus_select_chip(struct mtd_info *mtd, int chip)
static void doc200x_select_chip(struct mtd_info *mtd, int chip)
{
struct nand_chip *this = mtd->priv;
struct doc_priv *doc = (void *)this->priv;
struct doc_priv *doc = this->priv;
void __iomem *docptr = doc->virtadr;
int floor = 0;
......@@ -697,7 +697,7 @@ static void doc200x_select_chip(struct mtd_info *mtd, int chip)
static void doc200x_hwcontrol(struct mtd_info *mtd, int cmd)
{
struct nand_chip *this = mtd->priv;
struct doc_priv *doc = (void *)this->priv;
struct doc_priv *doc = this->priv;
void __iomem *docptr = doc->virtadr;
switch(cmd) {
......@@ -735,7 +735,7 @@ static void doc200x_hwcontrol(struct mtd_info *mtd, int cmd)
static void doc2001plus_command (struct mtd_info *mtd, unsigned command, int column, int page_addr)
{
struct nand_chip *this = mtd->priv;
struct doc_priv *doc = (void *)this->priv;
struct doc_priv *doc = this->priv;
void __iomem *docptr = doc->virtadr;
/*
......@@ -839,7 +839,7 @@ static void doc2001plus_command (struct mtd_info *mtd, unsigned command, int col
static int doc200x_dev_ready(struct mtd_info *mtd)
{
struct nand_chip *this = mtd->priv;
struct doc_priv *doc = (void *)this->priv;
struct doc_priv *doc = this->priv;
void __iomem *docptr = doc->virtadr;
if (DoC_is_MillenniumPlus(doc)) {
......@@ -877,7 +877,7 @@ static int doc200x_block_bad(struct mtd_info *mtd, loff_t ofs, int getchip)
static void doc200x_enable_hwecc(struct mtd_info *mtd, int mode)
{
struct nand_chip *this = mtd->priv;
struct doc_priv *doc = (void *)this->priv;
struct doc_priv *doc = this->priv;
void __iomem *docptr = doc->virtadr;
/* Prime the ECC engine */
......@@ -896,7 +896,7 @@ static void doc200x_enable_hwecc(struct mtd_info *mtd, int mode)
static void doc2001plus_enable_hwecc(struct mtd_info *mtd, int mode)
{
struct nand_chip *this = mtd->priv;
struct doc_priv *doc = (void *)this->priv;
struct doc_priv *doc = this->priv;
void __iomem *docptr = doc->virtadr;
/* Prime the ECC engine */
......@@ -917,7 +917,7 @@ static int doc200x_calculate_ecc(struct mtd_info *mtd, const u_char *dat,
unsigned char *ecc_code)
{
struct nand_chip *this = mtd->priv;
struct doc_priv *doc = (void *)this->priv;
struct doc_priv *doc = this->priv;
void __iomem *docptr = doc->virtadr;
int i;
int emptymatch = 1;
......@@ -975,7 +975,7 @@ static int doc200x_correct_data(struct mtd_info *mtd, u_char *dat, u_char *read_
{
int i, ret = 0;
struct nand_chip *this = mtd->priv;
struct doc_priv *doc = (void *)this->priv;
struct doc_priv *doc = this->priv;
void __iomem *docptr = doc->virtadr;
volatile u_char dummy;
int emptymatch = 1;
......@@ -1063,7 +1063,7 @@ static int __init find_media_headers(struct mtd_info *mtd, u_char *buf,
const char *id, int findmirror)
{
struct nand_chip *this = mtd->priv;
struct doc_priv *doc = (void *)this->priv;
struct doc_priv *doc = this->priv;
unsigned offs, end = (MAX_MEDIAHEADER_SCAN << this->phys_erase_shift);
int ret;
size_t retlen;
......@@ -1106,7 +1106,7 @@ static inline int __init nftl_partscan(struct mtd_info *mtd,
struct mtd_partition *parts)
{
struct nand_chip *this = mtd->priv;
struct doc_priv *doc = (void *)this->priv;
struct doc_priv *doc = this->priv;
int ret = 0;
u_char *buf;
struct NFTLMediaHeader *mh;
......@@ -1202,7 +1202,7 @@ static inline int __init inftl_partscan(struct mtd_info *mtd,
struct mtd_partition *parts)
{
struct nand_chip *this = mtd->priv;
struct doc_priv *doc = (void *)this->priv;
struct doc_priv *doc = this->priv;
int ret = 0;
u_char *buf;
struct INFTLMediaHeader *mh;
......@@ -1327,7 +1327,7 @@ static int __init nftl_scan_bbt(struct mtd_info *mtd)
{
int ret, numparts;
struct nand_chip *this = mtd->priv;
struct doc_priv *doc = (void *)this->priv;
struct doc_priv *doc = this->priv;
struct mtd_partition parts[2];
memset((char *) parts, 0, sizeof(parts));
......@@ -1366,7 +1366,7 @@ static int __init inftl_scan_bbt(struct mtd_info *mtd)
{
int ret, numparts;
struct nand_chip *this = mtd->priv;
struct doc_priv *doc = (void *)this->priv;
struct doc_priv *doc = this->priv;
struct mtd_partition parts[5];
if (this->numchips > doc->chips_per_floor) {
......@@ -1425,7 +1425,7 @@ static int __init inftl_scan_bbt(struct mtd_info *mtd)
static inline int __init doc2000_init(struct mtd_info *mtd)
{
struct nand_chip *this = mtd->priv;
struct doc_priv *doc = (void *)this->priv;
struct doc_priv *doc = this->priv;
this->write_byte = doc2000_write_byte;
this->read_byte = doc2000_read_byte;
......@@ -1443,7 +1443,7 @@ static inline int __init doc2000_init(struct mtd_info *mtd)
static inline int __init doc2001_init(struct mtd_info *mtd)
{
struct nand_chip *this = mtd->priv;
struct doc_priv *doc = (void *)this->priv;
struct doc_priv *doc = this->priv;
this->write_byte = doc2001_write_byte;
this->read_byte = doc2001_read_byte;
......@@ -1475,7 +1475,7 @@ static inline int __init doc2001_init(struct mtd_info *mtd)
static inline int __init doc2001plus_init(struct mtd_info *mtd)
{
struct nand_chip *this = mtd->priv;
struct doc_priv *doc = (void *)this->priv;
struct doc_priv *doc = this->priv;
this->write_byte = NULL;
this->read_byte = doc2001plus_read_byte;
......@@ -1597,7 +1597,7 @@ static inline int __init doc_probe(unsigned long physadr)
unsigned char oldval;
unsigned char newval;
nand = mtd->priv;
doc = (void *)nand->priv;
doc = nand->priv;
/* Use the alias resolution register to determine if this is
in fact the same DOC aliased to a new address. If writes
to one chip's alias resolution register change the value on
......@@ -1646,10 +1646,10 @@ static inline int __init doc_probe(unsigned long physadr)
nand->bbt_td = (struct nand_bbt_descr *) (doc + 1);
nand->bbt_md = nand->bbt_td + 1;
mtd->priv = (void *) nand;
mtd->priv = nand;
mtd->owner = THIS_MODULE;
nand->priv = (void *) doc;
nand->priv = doc;
nand->select_chip = doc200x_select_chip;
nand->hwcontrol = doc200x_hwcontrol;
nand->dev_ready = doc200x_dev_ready;
......@@ -1712,7 +1712,7 @@ static void release_nanddoc(void)
for (mtd = doclist; mtd; mtd = nextmtd) {
nand = mtd->priv;
doc = (void *)nand->priv;
doc = nand->priv;
nextmtd = doc->nextdoc;
nand_release(mtd);
......
......@@ -11,7 +11,7 @@
* 28-Sep-2004 BJD Fixed ECC placement for Hardware mode
* 12-Oct-2004 BJD Fixed errors in use of platform data
*
* $Id: s3c2410.c,v 1.6 2004/11/24 12:25:48 bjd Exp $
* $Id: s3c2410.c,v 1.7 2005/01/05 18:05:14 dwmw2 Exp $
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -117,12 +117,12 @@ static struct s3c2410_nand_info *s3c2410_nand_mtd_toinfo(struct mtd_info *mtd)
static struct s3c2410_nand_info *to_nand_info(struct device *dev)
{
return (struct s3c2410_nand_info *)dev_get_drvdata(dev);
return dev_get_drvdata(dev);
}
static struct s3c2410_platform_nand *to_nand_plat(struct device *dev)
{
return (struct s3c2410_platform_nand *)dev->platform_data;
return dev->platform_data;
}
/* timing calculations */
......@@ -205,7 +205,7 @@ static void s3c2410_nand_select_chip(struct mtd_info *mtd, int chip)
struct nand_chip *this = mtd->priv;
unsigned long cur;
nmtd = (struct s3c2410_nand_mtd *)this->priv;
nmtd = this->priv;
info = nmtd->info;
cur = readl(info->regs + S3C2410_NFCONF);
......@@ -424,14 +424,14 @@ static int s3c2410_nand_calculate_ecc(struct mtd_info *mtd,
static void s3c2410_nand_read_buf(struct mtd_info *mtd, u_char *buf, int len)
{
struct nand_chip *this = (struct nand_chip *)mtd->priv;
struct nand_chip *this = mtd->priv;
readsb(this->IO_ADDR_R, buf, len);
}
static void s3c2410_nand_write_buf(struct mtd_info *mtd,
const u_char *buf, int len)
{
struct nand_chip *this = (struct nand_chip *)mtd->priv;
struct nand_chip *this = mtd->priv;
writesb(this->IO_ADDR_W, buf, len);
}
......
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