Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Linux-御风守护者
linux
提交
4d42e1bb
L
linux
项目概览
Linux-御风守护者
/
linux
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
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,发现更多精彩内容 >>
提交
4d42e1bb
编写于
8月 28, 2006
作者:
G
Greg Kroah-Hartman
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
USB: fix __must_check warnings in drivers/usb/misc/
Signed-off-by:
N
Greg Kroah-Hartman
<
gregkh@suse.de
>
上级
1b21d5e1
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
57 addition
and
17 deletion
+57
-17
drivers/usb/misc/cypress_cy7c63.c
drivers/usb/misc/cypress_cy7c63.c
+15
-4
drivers/usb/misc/cytherm.c
drivers/usb/misc/cytherm.c
+26
-9
drivers/usb/misc/usbled.c
drivers/usb/misc/usbled.c
+16
-4
未找到文件。
drivers/usb/misc/cypress_cy7c63.c
浏览文件 @
4d42e1bb
...
...
@@ -209,7 +209,7 @@ static int cypress_probe(struct usb_interface *interface,
dev
=
kzalloc
(
sizeof
(
*
dev
),
GFP_KERNEL
);
if
(
dev
==
NULL
)
{
dev_err
(
&
interface
->
dev
,
"Out of memory!
\n
"
);
goto
error
;
goto
error
_mem
;
}
dev
->
udev
=
usb_get_dev
(
interface_to_usbdev
(
interface
));
...
...
@@ -218,15 +218,26 @@ static int cypress_probe(struct usb_interface *interface,
usb_set_intfdata
(
interface
,
dev
);
/* create device attribute files */
device_create_file
(
&
interface
->
dev
,
&
dev_attr_port0
);
device_create_file
(
&
interface
->
dev
,
&
dev_attr_port1
);
retval
=
device_create_file
(
&
interface
->
dev
,
&
dev_attr_port0
);
if
(
retval
)
goto
error
;
retval
=
device_create_file
(
&
interface
->
dev
,
&
dev_attr_port1
);
if
(
retval
)
goto
error
;
/* let the user know that the device is now attached */
dev_info
(
&
interface
->
dev
,
"Cypress CY7C63xxx device now attached
\n
"
);
return
0
;
retval
=
0
;
error:
device_remove_file
(
&
interface
->
dev
,
&
dev_attr_port0
);
device_remove_file
(
&
interface
->
dev
,
&
dev_attr_port1
);
usb_set_intfdata
(
interface
,
NULL
);
usb_put_dev
(
dev
->
udev
);
kfree
(
dev
);
error_mem:
return
retval
;
}
...
...
drivers/usb/misc/cytherm.c
浏览文件 @
4d42e1bb
...
...
@@ -353,7 +353,7 @@ static int cytherm_probe(struct usb_interface *interface,
dev
=
kzalloc
(
sizeof
(
struct
usb_cytherm
),
GFP_KERNEL
);
if
(
dev
==
NULL
)
{
dev_err
(
&
interface
->
dev
,
"Out of memory
\n
"
);
goto
error
;
goto
error
_mem
;
}
dev
->
udev
=
usb_get_dev
(
udev
);
...
...
@@ -362,18 +362,35 @@ static int cytherm_probe(struct usb_interface *interface,
dev
->
brightness
=
0xFF
;
device_create_file
(
&
interface
->
dev
,
&
dev_attr_brightness
);
device_create_file
(
&
interface
->
dev
,
&
dev_attr_temp
);
device_create_file
(
&
interface
->
dev
,
&
dev_attr_button
);
device_create_file
(
&
interface
->
dev
,
&
dev_attr_port0
);
device_create_file
(
&
interface
->
dev
,
&
dev_attr_port1
);
retval
=
device_create_file
(
&
interface
->
dev
,
&
dev_attr_brightness
);
if
(
retval
)
goto
error
;
retval
=
device_create_file
(
&
interface
->
dev
,
&
dev_attr_temp
);
if
(
retval
)
goto
error
;
retval
=
device_create_file
(
&
interface
->
dev
,
&
dev_attr_button
);
if
(
retval
)
goto
error
;
retval
=
device_create_file
(
&
interface
->
dev
,
&
dev_attr_port0
);
if
(
retval
)
goto
error
;
retval
=
device_create_file
(
&
interface
->
dev
,
&
dev_attr_port1
);
if
(
retval
)
goto
error
;
dev_info
(
&
interface
->
dev
,
dev_info
(
&
interface
->
dev
,
"Cypress thermometer device now attached
\n
"
);
return
0
;
error:
error:
device_remove_file
(
&
interface
->
dev
,
&
dev_attr_brightness
);
device_remove_file
(
&
interface
->
dev
,
&
dev_attr_temp
);
device_remove_file
(
&
interface
->
dev
,
&
dev_attr_button
);
device_remove_file
(
&
interface
->
dev
,
&
dev_attr_port0
);
device_remove_file
(
&
interface
->
dev
,
&
dev_attr_port1
);
usb_set_intfdata
(
interface
,
NULL
);
usb_put_dev
(
dev
->
udev
);
kfree
(
dev
);
error_mem:
return
retval
;
}
...
...
drivers/usb/misc/usbled.c
浏览文件 @
4d42e1bb
...
...
@@ -108,22 +108,34 @@ static int led_probe(struct usb_interface *interface, const struct usb_device_id
dev
=
kzalloc
(
sizeof
(
struct
usb_led
),
GFP_KERNEL
);
if
(
dev
==
NULL
)
{
dev_err
(
&
interface
->
dev
,
"Out of memory
\n
"
);
goto
error
;
goto
error
_mem
;
}
dev
->
udev
=
usb_get_dev
(
udev
);
usb_set_intfdata
(
interface
,
dev
);
device_create_file
(
&
interface
->
dev
,
&
dev_attr_blue
);
device_create_file
(
&
interface
->
dev
,
&
dev_attr_red
);
device_create_file
(
&
interface
->
dev
,
&
dev_attr_green
);
retval
=
device_create_file
(
&
interface
->
dev
,
&
dev_attr_blue
);
if
(
retval
)
goto
error
;
retval
=
device_create_file
(
&
interface
->
dev
,
&
dev_attr_red
);
if
(
retval
)
goto
error
;
retval
=
device_create_file
(
&
interface
->
dev
,
&
dev_attr_green
);
if
(
retval
)
goto
error
;
dev_info
(
&
interface
->
dev
,
"USB LED device now attached
\n
"
);
return
0
;
error:
device_remove_file
(
&
interface
->
dev
,
&
dev_attr_blue
);
device_remove_file
(
&
interface
->
dev
,
&
dev_attr_red
);
device_remove_file
(
&
interface
->
dev
,
&
dev_attr_green
);
usb_set_intfdata
(
interface
,
NULL
);
usb_put_dev
(
dev
->
udev
);
kfree
(
dev
);
error_mem:
return
retval
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录