Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
271c5c59
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
271c5c59
编写于
6月 04, 2008
作者:
D
David Woodhouse
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[MTD] DataFlash: use proper types
Signed-off-by:
N
David Woodhouse
<
dwmw2@infradead.org
>
上级
e9d42227
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
16 addition
and
16 deletion
+16
-16
drivers/mtd/devices/mtd_dataflash.c
drivers/mtd/devices/mtd_dataflash.c
+16
-16
未找到文件。
drivers/mtd/devices/mtd_dataflash.c
浏览文件 @
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
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录