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
Kirill Smelkov
linux
Commits
0873c764
Commit
0873c764
authored
Jun 20, 2006
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
USB: convert usb class devices to real devices
Signed-off-by:
Greg Kroah-Hartman
<
gregkh@suse.de
>
parent
7bc3d635
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
drivers/usb/core/file.c
drivers/usb/core/file.c
+6
-7
include/linux/usb.h
include/linux/usb.h
+3
-2
No files found.
drivers/usb/core/file.c
View file @
0873c764
...
...
@@ -194,14 +194,13 @@ int usb_register_dev(struct usb_interface *intf,
++
temp
;
else
temp
=
name
;
intf
->
class_dev
=
class_device_create
(
usb_class
->
class
,
NULL
,
MKDEV
(
USB_MAJOR
,
minor
),
&
intf
->
dev
,
"%s"
,
temp
);
if
(
IS_ERR
(
intf
->
class_dev
))
{
intf
->
usb_dev
=
device_create
(
usb_class
->
class
,
&
intf
->
dev
,
MKDEV
(
USB_MAJOR
,
minor
),
"%s"
,
temp
);
if
(
IS_ERR
(
intf
->
usb_dev
))
{
spin_lock
(
&
minor_lock
);
usb_minors
[
intf
->
minor
]
=
NULL
;
spin_unlock
(
&
minor_lock
);
retval
=
PTR_ERR
(
intf
->
class
_dev
);
retval
=
PTR_ERR
(
intf
->
usb
_dev
);
}
exit:
return
retval
;
...
...
@@ -242,8 +241,8 @@ void usb_deregister_dev(struct usb_interface *intf,
spin_unlock
(
&
minor_lock
);
snprintf
(
name
,
BUS_ID_SIZE
,
class_driver
->
name
,
intf
->
minor
-
minor_base
);
class_
device_destroy
(
usb_class
->
class
,
MKDEV
(
USB_MAJOR
,
intf
->
minor
));
intf
->
class
_dev
=
NULL
;
device_destroy
(
usb_class
->
class
,
MKDEV
(
USB_MAJOR
,
intf
->
minor
));
intf
->
usb
_dev
=
NULL
;
intf
->
minor
=
-
1
;
destroy_usb_class
();
}
...
...
include/linux/usb.h
View file @
0873c764
...
...
@@ -107,7 +107,8 @@ enum usb_interface_condition {
* @needs_remote_wakeup: flag set when the driver requires remote-wakeup
* capability during autosuspend.
* @dev: driver model's view of this device
* @class_dev: driver model's class view of this device.
* @usb_dev: if an interface is bound to the USB major, this will point
* to the sysfs representation for that device.
* @pm_usage_cnt: PM usage counter for this interface; autosuspend is not
* allowed unless the counter is 0.
*
...
...
@@ -152,7 +153,7 @@ struct usb_interface {
unsigned
needs_remote_wakeup
:
1
;
/* driver requires remote wakeup */
struct
device
dev
;
/* interface specific device info */
struct
class_device
*
class_dev
;
struct
device
*
usb_dev
;
/* pointer to the usb class's device, if any */
int
pm_usage_cnt
;
/* usage counter for autosuspend */
};
#define to_usb_interface(d) container_of(d, struct usb_interface, dev)
...
...
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