Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
kernel_linux
提交
8757091b
K
kernel_linux
项目概览
OpenHarmony
/
kernel_linux
上一次同步 4 年多
通知
15
Star
8
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kernel_linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
8757091b
编写于
6月 18, 2015
作者:
M
Mark Brown
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'spi/fix/core' into spi-linus
上级
0f57d867
4b786458
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
28 addition
and
17 deletion
+28
-17
drivers/spi/spi.c
drivers/spi/spi.c
+28
-17
未找到文件。
drivers/spi/spi.c
浏览文件 @
8757091b
...
@@ -571,7 +571,7 @@ static int __spi_map_msg(struct spi_master *master, struct spi_message *msg)
...
@@ -571,7 +571,7 @@ static int __spi_map_msg(struct spi_master *master, struct spi_message *msg)
return
0
;
return
0
;
}
}
static
int
spi_unmap_msg
(
struct
spi_master
*
master
,
struct
spi_message
*
msg
)
static
int
__
spi_unmap_msg
(
struct
spi_master
*
master
,
struct
spi_message
*
msg
)
{
{
struct
spi_transfer
*
xfer
;
struct
spi_transfer
*
xfer
;
struct
device
*
tx_dev
,
*
rx_dev
;
struct
device
*
tx_dev
,
*
rx_dev
;
...
@@ -583,15 +583,6 @@ static int spi_unmap_msg(struct spi_master *master, struct spi_message *msg)
...
@@ -583,15 +583,6 @@ static int spi_unmap_msg(struct spi_master *master, struct spi_message *msg)
rx_dev
=
master
->
dma_rx
->
device
->
dev
;
rx_dev
=
master
->
dma_rx
->
device
->
dev
;
list_for_each_entry
(
xfer
,
&
msg
->
transfers
,
transfer_list
)
{
list_for_each_entry
(
xfer
,
&
msg
->
transfers
,
transfer_list
)
{
/*
* Restore the original value of tx_buf or rx_buf if they are
* NULL.
*/
if
(
xfer
->
tx_buf
==
master
->
dummy_tx
)
xfer
->
tx_buf
=
NULL
;
if
(
xfer
->
rx_buf
==
master
->
dummy_rx
)
xfer
->
rx_buf
=
NULL
;
if
(
!
master
->
can_dma
(
master
,
msg
->
spi
,
xfer
))
if
(
!
master
->
can_dma
(
master
,
msg
->
spi
,
xfer
))
continue
;
continue
;
...
@@ -608,13 +599,32 @@ static inline int __spi_map_msg(struct spi_master *master,
...
@@ -608,13 +599,32 @@ static inline int __spi_map_msg(struct spi_master *master,
return
0
;
return
0
;
}
}
static
inline
int
spi_unmap_msg
(
struct
spi_master
*
master
,
static
inline
int
__
spi_unmap_msg
(
struct
spi_master
*
master
,
struct
spi_message
*
msg
)
struct
spi_message
*
msg
)
{
{
return
0
;
return
0
;
}
}
#endif
/* !CONFIG_HAS_DMA */
#endif
/* !CONFIG_HAS_DMA */
static
inline
int
spi_unmap_msg
(
struct
spi_master
*
master
,
struct
spi_message
*
msg
)
{
struct
spi_transfer
*
xfer
;
list_for_each_entry
(
xfer
,
&
msg
->
transfers
,
transfer_list
)
{
/*
* Restore the original value of tx_buf or rx_buf if they are
* NULL.
*/
if
(
xfer
->
tx_buf
==
master
->
dummy_tx
)
xfer
->
tx_buf
=
NULL
;
if
(
xfer
->
rx_buf
==
master
->
dummy_rx
)
xfer
->
rx_buf
=
NULL
;
}
return
__spi_unmap_msg
(
master
,
msg
);
}
static
int
spi_map_msg
(
struct
spi_master
*
master
,
struct
spi_message
*
msg
)
static
int
spi_map_msg
(
struct
spi_master
*
master
,
struct
spi_message
*
msg
)
{
{
struct
spi_transfer
*
xfer
;
struct
spi_transfer
*
xfer
;
...
@@ -988,9 +998,6 @@ void spi_finalize_current_message(struct spi_master *master)
...
@@ -988,9 +998,6 @@ void spi_finalize_current_message(struct spi_master *master)
spin_lock_irqsave
(
&
master
->
queue_lock
,
flags
);
spin_lock_irqsave
(
&
master
->
queue_lock
,
flags
);
mesg
=
master
->
cur_msg
;
mesg
=
master
->
cur_msg
;
master
->
cur_msg
=
NULL
;
queue_kthread_work
(
&
master
->
kworker
,
&
master
->
pump_messages
);
spin_unlock_irqrestore
(
&
master
->
queue_lock
,
flags
);
spin_unlock_irqrestore
(
&
master
->
queue_lock
,
flags
);
spi_unmap_msg
(
master
,
mesg
);
spi_unmap_msg
(
master
,
mesg
);
...
@@ -1003,9 +1010,13 @@ void spi_finalize_current_message(struct spi_master *master)
...
@@ -1003,9 +1010,13 @@ void spi_finalize_current_message(struct spi_master *master)
}
}
}
}
trace_spi_message_done
(
mesg
);
spin_lock_irqsave
(
&
master
->
queue_lock
,
flags
);
master
->
cur_msg
=
NULL
;
master
->
cur_msg_prepared
=
false
;
master
->
cur_msg_prepared
=
false
;
queue_kthread_work
(
&
master
->
kworker
,
&
master
->
pump_messages
);
spin_unlock_irqrestore
(
&
master
->
queue_lock
,
flags
);
trace_spi_message_done
(
mesg
);
mesg
->
state
=
NULL
;
mesg
->
state
=
NULL
;
if
(
mesg
->
complete
)
if
(
mesg
->
complete
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录