Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
69ea672a
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看板
提交
69ea672a
编写于
7月 10, 2013
作者:
M
Mark Brown
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
spi/omap-100k: Use core functionality to check validity of transfers
Signed-off-by:
N
Mark Brown
<
broonie@linaro.org
>
上级
407d600f
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
2 addition
and
30 deletion
+2
-30
drivers/spi/spi-omap-100k.c
drivers/spi/spi-omap-100k.c
+2
-30
未找到文件。
drivers/spi/spi-omap-100k.c
浏览文件 @
69ea672a
...
...
@@ -424,7 +424,6 @@ static int omap1_spi100k_transfer(struct spi_device *spi, struct spi_message *m)
{
struct
omap1_spi100k
*
spi100k
;
unsigned
long
flags
;
struct
spi_transfer
*
t
;
m
->
actual_length
=
0
;
m
->
status
=
-
EINPROGRESS
;
...
...
@@ -435,35 +434,6 @@ static int omap1_spi100k_transfer(struct spi_device *spi, struct spi_message *m)
if
(
spi100k
->
state
==
SPI_SHUTDOWN
)
return
-
ESHUTDOWN
;
/* reject invalid messages and transfers */
if
(
list_empty
(
&
m
->
transfers
)
||
!
m
->
complete
)
return
-
EINVAL
;
list_for_each_entry
(
t
,
&
m
->
transfers
,
transfer_list
)
{
const
void
*
tx_buf
=
t
->
tx_buf
;
void
*
rx_buf
=
t
->
rx_buf
;
unsigned
len
=
t
->
len
;
if
(
t
->
speed_hz
>
OMAP1_SPI100K_MAX_FREQ
||
(
len
&&
!
(
rx_buf
||
tx_buf
)))
{
dev_dbg
(
&
spi
->
dev
,
"transfer: %d Hz, %d %s%s, %d bpw
\n
"
,
t
->
speed_hz
,
len
,
tx_buf
?
"tx"
:
""
,
rx_buf
?
"rx"
:
""
,
t
->
bits_per_word
);
return
-
EINVAL
;
}
if
(
t
->
speed_hz
&&
t
->
speed_hz
<
OMAP1_SPI100K_MAX_FREQ
/
(
1
<<
16
))
{
dev_dbg
(
&
spi
->
dev
,
"%d Hz max exceeds %d
\n
"
,
t
->
speed_hz
,
OMAP1_SPI100K_MAX_FREQ
/
(
1
<<
16
));
return
-
EINVAL
;
}
}
spin_lock_irqsave
(
&
spi100k
->
lock
,
flags
);
list_add_tail
(
&
m
->
queue
,
&
spi100k
->
msg_queue
);
queue_work
(
omap1_spi100k_wq
,
&
spi100k
->
work
);
...
...
@@ -496,6 +466,8 @@ static int omap1_spi100k_probe(struct platform_device *pdev)
master
->
num_chipselect
=
2
;
master
->
mode_bits
=
MODEBITS
;
master
->
bits_per_word_mask
=
SPI_BPW_RANGE_MASK
(
4
,
32
);
master
->
min_speed_hz
=
OMAP1_SPI100K_MAX_FREQ
/
(
1
<<
16
);
master
->
max_speed_hz
=
OMAP1_SPI100K_MAX_FREQ
;
platform_set_drvdata
(
pdev
,
master
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录