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
8be9c8de
Commit
8be9c8de
authored
Feb 08, 2004
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Driver Core: fix up list_for_each() calls to list_for_each_entry()
Now this should get that Rusty^Wmonkey off my back...
parent
97018fa9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
21 deletions
+8
-21
drivers/base/class.c
drivers/base/class.c
+7
-18
drivers/base/class_simple.c
drivers/base/class_simple.c
+1
-3
No files found.
drivers/base/class.c
View file @
8be9c8de
...
...
@@ -3,8 +3,8 @@
*
* Copyright (c) 2002-3 Patrick Mochel
* Copyright (c) 2002-3 Open Source Development Labs
* Copyright (c) 2003 Greg Kroah-Hartman
* Copyright (c) 2003 IBM Corp.
* Copyright (c) 2003
-2004
Greg Kroah-Hartman
* Copyright (c) 2003
-2004
IBM Corp.
*
* This file is released under the GPLv2
*
...
...
@@ -278,7 +278,6 @@ int class_device_add(struct class_device *class_dev)
{
struct
class
*
parent
;
struct
class_interface
*
class_intf
;
struct
list_head
*
entry
;
int
error
;
class_dev
=
class_device_get
(
class_dev
);
...
...
@@ -302,11 +301,9 @@ int class_device_add(struct class_device *class_dev)
if
(
parent
)
{
down_write
(
&
parent
->
subsys
.
rwsem
);
list_add_tail
(
&
class_dev
->
node
,
&
parent
->
children
);
list_for_each
(
entry
,
&
parent
->
interfaces
)
{
class_intf
=
container_of
(
entry
,
struct
class_interface
,
node
);
list_for_each_entry
(
class_intf
,
&
parent
->
interfaces
,
node
)
if
(
class_intf
->
add
)
class_intf
->
add
(
class_dev
);
}
up_write
(
&
parent
->
subsys
.
rwsem
);
}
...
...
@@ -330,16 +327,13 @@ void class_device_del(struct class_device *class_dev)
{
struct
class
*
parent
=
class_dev
->
class
;
struct
class_interface
*
class_intf
;
struct
list_head
*
entry
;
if
(
parent
)
{
down_write
(
&
parent
->
subsys
.
rwsem
);
list_del_init
(
&
class_dev
->
node
);
list_for_each
(
entry
,
&
parent
->
interfaces
)
{
class_intf
=
container_of
(
entry
,
struct
class_interface
,
node
);
list_for_each_entry
(
class_intf
,
&
parent
->
interfaces
,
node
)
if
(
class_intf
->
remove
)
class_intf
->
remove
(
class_dev
);
}
up_write
(
&
parent
->
subsys
.
rwsem
);
}
...
...
@@ -395,7 +389,6 @@ int class_interface_register(struct class_interface *class_intf)
{
struct
class
*
parent
;
struct
class_device
*
class_dev
;
struct
list_head
*
entry
;
if
(
!
class_intf
||
!
class_intf
->
class
)
return
-
ENODEV
;
...
...
@@ -408,10 +401,8 @@ int class_interface_register(struct class_interface *class_intf)
list_add_tail
(
&
class_intf
->
node
,
&
parent
->
interfaces
);
if
(
class_intf
->
add
)
{
list_for_each
(
entry
,
&
parent
->
children
)
{
class_dev
=
container_of
(
entry
,
struct
class_device
,
node
);
list_for_each_entry
(
class_dev
,
&
parent
->
children
,
node
)
class_intf
->
add
(
class_dev
);
}
}
up_write
(
&
parent
->
subsys
.
rwsem
);
...
...
@@ -421,7 +412,7 @@ int class_interface_register(struct class_interface *class_intf)
void
class_interface_unregister
(
struct
class_interface
*
class_intf
)
{
struct
class
*
parent
=
class_intf
->
class
;
struct
list_head
*
entry
;
struct
class_device
*
class_dev
;
if
(
!
parent
)
return
;
...
...
@@ -430,10 +421,8 @@ void class_interface_unregister(struct class_interface *class_intf)
list_del_init
(
&
class_intf
->
node
);
if
(
class_intf
->
remove
)
{
list_for_each
(
entry
,
&
parent
->
children
)
{
struct
class_device
*
class_dev
=
container_of
(
entry
,
struct
class_device
,
node
);
list_for_each_entry
(
class_dev
,
&
parent
->
children
,
node
)
class_intf
->
remove
(
class_dev
);
}
}
up_write
(
&
parent
->
subsys
.
rwsem
);
...
...
drivers/base/class_simple.c
View file @
8be9c8de
...
...
@@ -197,12 +197,10 @@ EXPORT_SYMBOL(class_simple_set_hotplug);
void
class_simple_device_remove
(
dev_t
dev
)
{
struct
simple_dev
*
s_dev
=
NULL
;
struct
list_head
*
tmp
;
int
found
=
0
;
spin_lock
(
&
simple_dev_list_lock
);
list_for_each
(
tmp
,
&
simple_dev_list
)
{
s_dev
=
list_entry
(
tmp
,
struct
simple_dev
,
node
);
list_for_each_entry
(
s_dev
,
&
simple_dev_list
,
node
)
{
if
(
s_dev
->
dev
==
dev
)
{
found
=
1
;
break
;
...
...
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