Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
4d42e1bb
Commit
4d42e1bb
authored
Aug 28, 2006
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
USB: fix __must_check warnings in drivers/usb/misc/
Signed-off-by:
Greg Kroah-Hartman
<
gregkh@suse.de
>
parent
1b21d5e1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
17 deletions
+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
No files found.
drivers/usb/misc/cypress_cy7c63.c
View file @
4d42e1bb
...
@@ -209,7 +209,7 @@ static int cypress_probe(struct usb_interface *interface,
...
@@ -209,7 +209,7 @@ static int cypress_probe(struct usb_interface *interface,
dev
=
kzalloc
(
sizeof
(
*
dev
),
GFP_KERNEL
);
dev
=
kzalloc
(
sizeof
(
*
dev
),
GFP_KERNEL
);
if
(
dev
==
NULL
)
{
if
(
dev
==
NULL
)
{
dev_err
(
&
interface
->
dev
,
"Out of memory!
\n
"
);
dev_err
(
&
interface
->
dev
,
"Out of memory!
\n
"
);
goto
error
;
goto
error
_mem
;
}
}
dev
->
udev
=
usb_get_dev
(
interface_to_usbdev
(
interface
));
dev
->
udev
=
usb_get_dev
(
interface_to_usbdev
(
interface
));
...
@@ -218,15 +218,26 @@ static int cypress_probe(struct usb_interface *interface,
...
@@ -218,15 +218,26 @@ static int cypress_probe(struct usb_interface *interface,
usb_set_intfdata
(
interface
,
dev
);
usb_set_intfdata
(
interface
,
dev
);
/* create device attribute files */
/* create device attribute files */
device_create_file
(
&
interface
->
dev
,
&
dev_attr_port0
);
retval
=
device_create_file
(
&
interface
->
dev
,
&
dev_attr_port0
);
device_create_file
(
&
interface
->
dev
,
&
dev_attr_port1
);
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 */
/* let the user know that the device is now attached */
dev_info
(
&
interface
->
dev
,
dev_info
(
&
interface
->
dev
,
"Cypress CY7C63xxx device now attached
\n
"
);
"Cypress CY7C63xxx device now attached
\n
"
);
return
0
;
retval
=
0
;
error:
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
;
return
retval
;
}
}
...
...
drivers/usb/misc/cytherm.c
View file @
4d42e1bb
...
@@ -353,7 +353,7 @@ static int cytherm_probe(struct usb_interface *interface,
...
@@ -353,7 +353,7 @@ static int cytherm_probe(struct usb_interface *interface,
dev
=
kzalloc
(
sizeof
(
struct
usb_cytherm
),
GFP_KERNEL
);
dev
=
kzalloc
(
sizeof
(
struct
usb_cytherm
),
GFP_KERNEL
);
if
(
dev
==
NULL
)
{
if
(
dev
==
NULL
)
{
dev_err
(
&
interface
->
dev
,
"Out of memory
\n
"
);
dev_err
(
&
interface
->
dev
,
"Out of memory
\n
"
);
goto
error
;
goto
error
_mem
;
}
}
dev
->
udev
=
usb_get_dev
(
udev
);
dev
->
udev
=
usb_get_dev
(
udev
);
...
@@ -362,18 +362,35 @@ static int cytherm_probe(struct usb_interface *interface,
...
@@ -362,18 +362,35 @@ static int cytherm_probe(struct usb_interface *interface,
dev
->
brightness
=
0xFF
;
dev
->
brightness
=
0xFF
;
device_create_file
(
&
interface
->
dev
,
&
dev_attr_brightness
);
retval
=
device_create_file
(
&
interface
->
dev
,
&
dev_attr_brightness
);
device_create_file
(
&
interface
->
dev
,
&
dev_attr_temp
);
if
(
retval
)
device_create_file
(
&
interface
->
dev
,
&
dev_attr_button
);
goto
error
;
device_create_file
(
&
interface
->
dev
,
&
dev_attr_port0
);
retval
=
device_create_file
(
&
interface
->
dev
,
&
dev_attr_temp
);
device_create_file
(
&
interface
->
dev
,
&
dev_attr_port1
);
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
"
);
"Cypress thermometer device now attached
\n
"
);
return
0
;
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
);
kfree
(
dev
);
error_mem:
return
retval
;
return
retval
;
}
}
...
...
drivers/usb/misc/usbled.c
View file @
4d42e1bb
...
@@ -108,22 +108,34 @@ static int led_probe(struct usb_interface *interface, const struct usb_device_id
...
@@ -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
);
dev
=
kzalloc
(
sizeof
(
struct
usb_led
),
GFP_KERNEL
);
if
(
dev
==
NULL
)
{
if
(
dev
==
NULL
)
{
dev_err
(
&
interface
->
dev
,
"Out of memory
\n
"
);
dev_err
(
&
interface
->
dev
,
"Out of memory
\n
"
);
goto
error
;
goto
error
_mem
;
}
}
dev
->
udev
=
usb_get_dev
(
udev
);
dev
->
udev
=
usb_get_dev
(
udev
);
usb_set_intfdata
(
interface
,
dev
);
usb_set_intfdata
(
interface
,
dev
);
device_create_file
(
&
interface
->
dev
,
&
dev_attr_blue
);
retval
=
device_create_file
(
&
interface
->
dev
,
&
dev_attr_blue
);
device_create_file
(
&
interface
->
dev
,
&
dev_attr_red
);
if
(
retval
)
device_create_file
(
&
interface
->
dev
,
&
dev_attr_green
);
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
"
);
dev_info
(
&
interface
->
dev
,
"USB LED device now attached
\n
"
);
return
0
;
return
0
;
error:
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
);
kfree
(
dev
);
error_mem:
return
retval
;
return
retval
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment