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
629b170a
Commit
629b170a
authored
Jun 30, 2003
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] USB: move ohci's sysfs files to the class device instead of the pci device.
parent
2bf9da39
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
15 deletions
+27
-15
drivers/usb/host/ohci-dbg.c
drivers/usb/host/ohci-dbg.c
+27
-15
No files found.
drivers/usb/host/ohci-dbg.c
View file @
629b170a
...
...
@@ -466,13 +466,17 @@ show_list (struct ohci_hcd *ohci, char *buf, size_t count, struct ed *ed)
}
static
ssize_t
show_async
(
struct
device
*
dev
,
char
*
buf
)
show_async
(
struct
class_device
*
class_
dev
,
char
*
buf
)
{
struct
usb_bus
*
bus
;
struct
usb_hcd
*
hcd
;
struct
ohci_hcd
*
ohci
;
size_t
temp
;
unsigned
long
flags
;
ohci
=
dev_to_ohci
(
dev
);
bus
=
to_usb_bus
(
class_dev
);
hcd
=
bus
->
hcpriv
;
ohci
=
hcd_to_ohci
(
hcd
);
/* display control and bulk lists together, for simplicity */
spin_lock_irqsave
(
&
ohci
->
lock
,
flags
);
...
...
@@ -482,14 +486,16 @@ show_async (struct device *dev, char *buf)
return
temp
;
}
static
DEVICE_ATTR
(
async
,
S_IRUGO
,
show_async
,
NULL
);
static
CLASS_
DEVICE_ATTR
(
async
,
S_IRUGO
,
show_async
,
NULL
);
#define DBG_SCHED_LIMIT 64
static
ssize_t
show_periodic
(
struct
device
*
dev
,
char
*
buf
)
show_periodic
(
struct
class_device
*
class_
dev
,
char
*
buf
)
{
struct
usb_bus
*
bus
;
struct
usb_hcd
*
hcd
;
struct
ohci_hcd
*
ohci
;
struct
ed
**
seen
,
*
ed
;
unsigned
long
flags
;
...
...
@@ -501,7 +507,9 @@ show_periodic (struct device *dev, char *buf)
return
0
;
seen_count
=
0
;
ohci
=
dev_to_ohci
(
dev
);
bus
=
to_usb_bus
(
class_dev
);
hcd
=
bus
->
hcpriv
;
ohci
=
hcd_to_ohci
(
hcd
);
next
=
buf
;
size
=
PAGE_SIZE
;
...
...
@@ -573,14 +581,16 @@ show_periodic (struct device *dev, char *buf)
return
PAGE_SIZE
-
size
;
}
static
DEVICE_ATTR
(
periodic
,
S_IRUGO
,
show_periodic
,
NULL
);
static
CLASS_
DEVICE_ATTR
(
periodic
,
S_IRUGO
,
show_periodic
,
NULL
);
#undef DBG_SCHED_LIMIT
static
ssize_t
show_registers
(
struct
device
*
dev
,
char
*
buf
)
show_registers
(
struct
class_device
*
class_
dev
,
char
*
buf
)
{
struct
usb_bus
*
bus
;
struct
usb_hcd
*
hcd
;
struct
ohci_hcd
*
ohci
;
struct
ohci_regs
*
regs
;
unsigned
long
flags
;
...
...
@@ -588,7 +598,9 @@ show_registers (struct device *dev, char *buf)
char
*
next
;
u32
rdata
;
ohci
=
dev_to_ohci
(
dev
);
bus
=
to_usb_bus
(
class_dev
);
hcd
=
bus
->
hcpriv
;
ohci
=
hcd_to_ohci
(
hcd
);
regs
=
ohci
->
regs
;
next
=
buf
;
size
=
PAGE_SIZE
;
...
...
@@ -642,22 +654,22 @@ show_registers (struct device *dev, char *buf)
return
PAGE_SIZE
-
size
;
}
static
DEVICE_ATTR
(
registers
,
S_IRUGO
,
show_registers
,
NULL
);
static
CLASS_
DEVICE_ATTR
(
registers
,
S_IRUGO
,
show_registers
,
NULL
);
static
inline
void
create_debug_files
(
struct
ohci_hcd
*
bus
)
{
device_create_file
(
bus
->
hcd
.
controller
,
&
dev
_attr_async
);
device_create_file
(
bus
->
hcd
.
controller
,
&
dev
_attr_periodic
);
device_create_file
(
bus
->
hcd
.
controller
,
&
dev
_attr_registers
);
class_device_create_file
(
&
bus
->
hcd
.
self
.
class_dev
,
&
class_device
_attr_async
);
class_device_create_file
(
&
bus
->
hcd
.
self
.
class_dev
,
&
class_device
_attr_periodic
);
class_device_create_file
(
&
bus
->
hcd
.
self
.
class_dev
,
&
class_device
_attr_registers
);
ohci_dbg
(
bus
,
"created debug files
\n
"
);
}
static
inline
void
remove_debug_files
(
struct
ohci_hcd
*
bus
)
{
device_remove_file
(
bus
->
hcd
.
controller
,
&
dev
_attr_async
);
device_remove_file
(
bus
->
hcd
.
controller
,
&
dev
_attr_periodic
);
device_remove_file
(
bus
->
hcd
.
controller
,
&
dev
_attr_registers
);
class_device_remove_file
(
&
bus
->
hcd
.
self
.
class_dev
,
&
class_device
_attr_async
);
class_device_remove_file
(
&
bus
->
hcd
.
self
.
class_dev
,
&
class_device
_attr_periodic
);
class_device_remove_file
(
&
bus
->
hcd
.
self
.
class_dev
,
&
class_device
_attr_registers
);
}
#endif
...
...
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