Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xiphi1978
linux
提交
13f4db9e
L
linux
项目概览
xiphi1978
/
linux
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
13f4db9e
编写于
8月 28, 2006
作者:
G
Greg Kroah-Hartman
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
USB: fix __must_check warnings in drivers/usb/serial/
Signed-off-by:
N
Greg Kroah-Hartman
<
gregkh@suse.de
>
上级
1ee95216
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
23 addition
and
12 deletion
+23
-12
drivers/usb/serial/ftdi_sio.c
drivers/usb/serial/ftdi_sio.c
+19
-11
drivers/usb/serial/usb-serial.c
drivers/usb/serial/usb-serial.c
+4
-1
未找到文件。
drivers/usb/serial/ftdi_sio.c
浏览文件 @
13f4db9e
...
...
@@ -1101,25 +1101,29 @@ static ssize_t store_event_char(struct device *dev, struct device_attribute *att
static
DEVICE_ATTR
(
latency_timer
,
S_IWUSR
|
S_IRUGO
,
show_latency_timer
,
store_latency_timer
);
static
DEVICE_ATTR
(
event_char
,
S_IWUSR
,
NULL
,
store_event_char
);
static
void
create_sysfs_attrs
(
struct
usb_serial
*
serial
)
{
static
int
create_sysfs_attrs
(
struct
usb_serial
*
serial
)
{
struct
ftdi_private
*
priv
;
struct
usb_device
*
udev
;
int
retval
=
0
;
dbg
(
"%s"
,
__FUNCTION__
);
priv
=
usb_get_serial_port_data
(
serial
->
port
[
0
]);
udev
=
serial
->
dev
;
/* XXX I've no idea if the original SIO supports the event_char
* sysfs parameter, so I'm playing it safe. */
if
(
priv
->
chip_type
!=
SIO
)
{
dbg
(
"sysfs attributes for %s"
,
ftdi_chip_name
[
priv
->
chip_type
]);
device_create_file
(
&
udev
->
dev
,
&
dev_attr_event_char
);
if
(
priv
->
chip_type
==
FT232BM
||
priv
->
chip_type
==
FT2232C
)
{
device_create_file
(
&
udev
->
dev
,
&
dev_attr_latency_timer
);
retval
=
device_create_file
(
&
udev
->
dev
,
&
dev_attr_event_char
);
if
((
!
retval
)
&&
(
priv
->
chip_type
==
FT232BM
||
priv
->
chip_type
==
FT2232C
))
{
retval
=
device_create_file
(
&
udev
->
dev
,
&
dev_attr_latency_timer
);
}
}
return
retval
;
}
static
void
remove_sysfs_attrs
(
struct
usb_serial
*
serial
)
...
...
@@ -1162,7 +1166,8 @@ static int ftdi_sio_attach (struct usb_serial *serial)
struct
usb_serial_port
*
port
=
serial
->
port
[
0
];
struct
ftdi_private
*
priv
;
struct
ftdi_sio_quirk
*
quirk
;
int
retval
;
dbg
(
"%s"
,
__FUNCTION__
);
priv
=
kzalloc
(
sizeof
(
struct
ftdi_private
),
GFP_KERNEL
);
...
...
@@ -1203,15 +1208,18 @@ static int ftdi_sio_attach (struct usb_serial *serial)
usb_set_serial_port_data
(
serial
->
port
[
0
],
priv
);
ftdi_determine_type
(
serial
->
port
[
0
]);
create_sysfs_attrs
(
serial
);
retval
=
create_sysfs_attrs
(
serial
);
if
(
retval
)
dev_err
(
&
serial
->
dev
->
dev
,
"Error creating sysfs files, "
"continuing
\n
"
);
/* Check for device requiring special set up. */
quirk
=
(
struct
ftdi_sio_quirk
*
)
usb_get_serial_data
(
serial
);
if
(
quirk
&&
quirk
->
setup
)
{
quirk
->
setup
(
serial
);
}
return
(
0
)
;
return
0
;
}
/* ftdi_sio_attach */
...
...
drivers/usb/serial/usb-serial.c
浏览文件 @
13f4db9e
...
...
@@ -932,7 +932,10 @@ int usb_serial_probe(struct usb_interface *interface,
snprintf
(
&
port
->
dev
.
bus_id
[
0
],
sizeof
(
port
->
dev
.
bus_id
),
"ttyUSB%d"
,
port
->
number
);
dbg
(
"%s - registering %s"
,
__FUNCTION__
,
port
->
dev
.
bus_id
);
device_register
(
&
port
->
dev
);
retval
=
device_register
(
&
port
->
dev
);
if
(
retval
)
dev_err
(
&
port
->
dev
,
"Error registering port device, "
"continuing
\n
"
);
}
usb_serial_console_init
(
debug
,
minor
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录