Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
0201ed03
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看板
提交
0201ed03
编写于
5月 31, 2012
作者:
S
Samuel Ortiz
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
NFC: Convert pn533 from semaphore to mutex
Signed-off-by:
N
Samuel Ortiz
<
sameo@linux.intel.com
>
上级
41a8ec49
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
7 addition
and
7 deletion
+7
-7
drivers/nfc/pn533.c
drivers/nfc/pn533.c
+7
-7
未找到文件。
drivers/nfc/pn533.c
浏览文件 @
0201ed03
...
@@ -329,7 +329,7 @@ struct pn533 {
...
@@ -329,7 +329,7 @@ struct pn533 {
pn533_cmd_complete_t
cmd_complete
;
pn533_cmd_complete_t
cmd_complete
;
void
*
cmd_complete_arg
;
void
*
cmd_complete_arg
;
struct
semaphore
cmd_lock
;
struct
mutex
cmd_lock
;
u8
cmd
;
u8
cmd
;
struct
pn533_poll_modulations
*
poll_mod_active
[
PN533_POLL_MOD_MAX
+
1
];
struct
pn533_poll_modulations
*
poll_mod_active
[
PN533_POLL_MOD_MAX
+
1
];
...
@@ -462,7 +462,7 @@ static void pn533_wq_cmd_complete(struct work_struct *work)
...
@@ -462,7 +462,7 @@ static void pn533_wq_cmd_complete(struct work_struct *work)
PN533_FRAME_CMD_PARAMS_LEN
(
in_frame
));
PN533_FRAME_CMD_PARAMS_LEN
(
in_frame
));
if
(
rc
!=
-
EINPROGRESS
)
if
(
rc
!=
-
EINPROGRESS
)
up
(
&
dev
->
cmd_lock
);
mutex_unlock
(
&
dev
->
cmd_lock
);
}
}
static
void
pn533_recv_response
(
struct
urb
*
urb
)
static
void
pn533_recv_response
(
struct
urb
*
urb
)
...
@@ -640,7 +640,7 @@ static int pn533_send_cmd_frame_async(struct pn533 *dev,
...
@@ -640,7 +640,7 @@ static int pn533_send_cmd_frame_async(struct pn533 *dev,
nfc_dev_dbg
(
&
dev
->
interface
->
dev
,
"%s"
,
__func__
);
nfc_dev_dbg
(
&
dev
->
interface
->
dev
,
"%s"
,
__func__
);
if
(
down
_trylock
(
&
dev
->
cmd_lock
))
if
(
!
mutex
_trylock
(
&
dev
->
cmd_lock
))
return
-
EBUSY
;
return
-
EBUSY
;
rc
=
__pn533_send_cmd_frame_async
(
dev
,
out_frame
,
in_frame
,
rc
=
__pn533_send_cmd_frame_async
(
dev
,
out_frame
,
in_frame
,
...
@@ -650,7 +650,7 @@ static int pn533_send_cmd_frame_async(struct pn533 *dev,
...
@@ -650,7 +650,7 @@ static int pn533_send_cmd_frame_async(struct pn533 *dev,
return
0
;
return
0
;
error:
error:
up
(
&
dev
->
cmd_lock
);
mutex_unlock
(
&
dev
->
cmd_lock
);
return
rc
;
return
rc
;
}
}
...
@@ -1261,7 +1261,7 @@ static void pn533_listen_mode_timer(unsigned long data)
...
@@ -1261,7 +1261,7 @@ static void pn533_listen_mode_timer(unsigned long data)
dev
->
cancel_listen
=
1
;
dev
->
cancel_listen
=
1
;
up
(
&
dev
->
cmd_lock
);
mutex_unlock
(
&
dev
->
cmd_lock
);
pn533_poll_next_mod
(
dev
);
pn533_poll_next_mod
(
dev
);
...
@@ -2054,7 +2054,7 @@ static void pn533_wq_mi_recv(struct work_struct *work)
...
@@ -2054,7 +2054,7 @@ static void pn533_wq_mi_recv(struct work_struct *work)
kfree
(
arg
);
kfree
(
arg
);
up
(
&
dev
->
cmd_lock
);
mutex_unlock
(
&
dev
->
cmd_lock
);
}
}
static
int
pn533_set_configuration
(
struct
pn533
*
dev
,
u8
cfgitem
,
u8
*
cfgdata
,
static
int
pn533_set_configuration
(
struct
pn533
*
dev
,
u8
cfgitem
,
u8
*
cfgdata
,
...
@@ -2114,7 +2114,7 @@ static int pn533_probe(struct usb_interface *interface,
...
@@ -2114,7 +2114,7 @@ static int pn533_probe(struct usb_interface *interface,
dev
->
udev
=
usb_get_dev
(
interface_to_usbdev
(
interface
));
dev
->
udev
=
usb_get_dev
(
interface_to_usbdev
(
interface
));
dev
->
interface
=
interface
;
dev
->
interface
=
interface
;
sema_init
(
&
dev
->
cmd_lock
,
1
);
mutex_init
(
&
dev
->
cmd_lock
);
iface_desc
=
interface
->
cur_altsetting
;
iface_desc
=
interface
->
cur_altsetting
;
for
(
i
=
0
;
i
<
iface_desc
->
desc
.
bNumEndpoints
;
++
i
)
{
for
(
i
=
0
;
i
<
iface_desc
->
desc
.
bNumEndpoints
;
++
i
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录