Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
271c5c59
Commit
271c5c59
authored
Jun 04, 2008
by
David Woodhouse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[MTD] DataFlash: use proper types
Signed-off-by:
David Woodhouse
<
dwmw2@infradead.org
>
parent
e9d42227
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
16 deletions
+16
-16
drivers/mtd/devices/mtd_dataflash.c
drivers/mtd/devices/mtd_dataflash.c
+16
-16
No files found.
drivers/mtd/devices/mtd_dataflash.c
View file @
271c5c59
...
...
@@ -82,7 +82,7 @@
struct
dataflash
{
u
8
command
[
4
];
u
int8_t
command
[
4
];
char
name
[
24
];
unsigned
partitioned
:
1
;
...
...
@@ -150,7 +150,7 @@ static int dataflash_erase(struct mtd_info *mtd, struct erase_info *instr)
struct
spi_transfer
x
=
{
.
tx_dma
=
0
,
};
struct
spi_message
msg
;
unsigned
blocksize
=
priv
->
page_size
<<
3
;
u
8
*
command
;
u
int8_t
*
command
;
DEBUG
(
MTD_DEBUG_LEVEL2
,
"%s: erase addr=0x%x len 0x%x
\n
"
,
spi
->
dev
.
bus_id
,
...
...
@@ -182,8 +182,8 @@ static int dataflash_erase(struct mtd_info *mtd, struct erase_info *instr)
pageaddr
=
pageaddr
<<
priv
->
page_offset
;
command
[
0
]
=
do_block
?
OP_ERASE_BLOCK
:
OP_ERASE_PAGE
;
command
[
1
]
=
(
u
8
)(
pageaddr
>>
16
);
command
[
2
]
=
(
u
8
)(
pageaddr
>>
8
);
command
[
1
]
=
(
u
int8_t
)(
pageaddr
>>
16
);
command
[
2
]
=
(
u
int8_t
)(
pageaddr
>>
8
);
command
[
3
]
=
0
;
DEBUG
(
MTD_DEBUG_LEVEL3
,
"ERASE %s: (%x) %x %x %x [%i]
\n
"
,
...
...
@@ -234,7 +234,7 @@ static int dataflash_read(struct mtd_info *mtd, loff_t from, size_t len,
struct
spi_transfer
x
[
2
]
=
{
{
.
tx_dma
=
0
,
},
};
struct
spi_message
msg
;
unsigned
int
addr
;
u
8
*
command
;
u
int8_t
*
command
;
int
status
;
DEBUG
(
MTD_DEBUG_LEVEL2
,
"%s: read 0x%x..0x%x
\n
"
,
...
...
@@ -274,9 +274,9 @@ static int dataflash_read(struct mtd_info *mtd, loff_t from, size_t len,
* fewer "don't care" bytes. Both buffers stay unchanged.
*/
command
[
0
]
=
OP_READ_CONTINUOUS
;
command
[
1
]
=
(
u
8
)(
addr
>>
16
);
command
[
2
]
=
(
u
8
)(
addr
>>
8
);
command
[
3
]
=
(
u
8
)(
addr
>>
0
);
command
[
1
]
=
(
u
int8_t
)(
addr
>>
16
);
command
[
2
]
=
(
u
int8_t
)(
addr
>>
8
);
command
[
3
]
=
(
u
int8_t
)(
addr
>>
0
);
/* plus 4 "don't care" bytes */
status
=
spi_sync
(
priv
->
spi
,
&
msg
);
...
...
@@ -311,7 +311,7 @@ static int dataflash_write(struct mtd_info *mtd, loff_t to, size_t len,
size_t
remaining
=
len
;
u_char
*
writebuf
=
(
u_char
*
)
buf
;
int
status
=
-
EINVAL
;
u
8
*
command
;
u
int8_t
*
command
;
DEBUG
(
MTD_DEBUG_LEVEL2
,
"%s: write 0x%x..0x%x
\n
"
,
spi
->
dev
.
bus_id
,
(
unsigned
)
to
,
(
unsigned
)(
to
+
len
));
...
...
@@ -539,16 +539,16 @@ struct flash_info {
* a high byte of zero plus three data bytes: the manufacturer id,
* then a two byte device id.
*/
u
32
jedec_id
;
u
int32_t
jedec_id
;
/* The size listed here is what works with OPCODE_SE, which isn't
* necessarily called a "sector" by the vendor.
*/
unsigned
nr_pages
;
u
16
pagesize
;
u
16
pageoffset
;
u
int16_t
pagesize
;
u
int16_t
pageoffset
;
u
16
flags
;
u
int16_t
flags
;
#define SUP_POW2PS 0x02
#define IS_POW2PS 0x01
};
...
...
@@ -582,9 +582,9 @@ static struct flash_info __devinitdata dataflash_data [] = {
static
struct
flash_info
*
__devinit
jedec_probe
(
struct
spi_device
*
spi
)
{
int
tmp
;
u
8
code
=
OP_READ_ID
;
u
8
id
[
3
];
u
32
jedec
;
u
int8_t
code
=
OP_READ_ID
;
u
int8_t
id
[
3
];
u
int32_t
jedec
;
struct
flash_info
*
info
;
int
status
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment