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
0b460a61
Commit
0b460a61
authored
Jan 31, 2004
by
Ben Collins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IEEE1394(r1116): Make sure to unregister addr space when a driver is removed.
parent
52dd1e04
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
36 deletions
+33
-36
drivers/ieee1394/highlevel.c
drivers/ieee1394/highlevel.c
+33
-36
No files found.
drivers/ieee1394/highlevel.c
View file @
0b460a61
...
...
@@ -261,30 +261,46 @@ void hpsb_register_highlevel(struct hpsb_highlevel *hl)
return
;
}
static
void
__unregister_host
(
struct
hpsb_highlevel
*
hl
,
struct
hpsb_host
*
host
)
{
unsigned
long
flags
;
struct
list_head
*
lh
,
*
next
;
struct
hpsb_address_serve
*
as
;
if
(
hl
->
remove_host
)
hl
->
remove_host
(
host
);
/* Remove any addresses that are matched for this highlevel driver
* and this particular host. */
write_lock_irqsave
(
&
addr_space_lock
,
flags
);
list_for_each_safe
(
lh
,
next
,
&
hl
->
addr_list
)
{
as
=
list_entry
(
lh
,
struct
hpsb_address_serve
,
addr_list
);
if
(
as
->
host
!=
host
)
continue
;
if
(
!
list_empty
(
&
as
->
addr_list
))
{
list_del
(
&
as
->
as_list
);
list_del
(
&
as
->
addr_list
);
kfree
(
as
);
}
}
write_unlock_irqrestore
(
&
addr_space_lock
,
flags
);
hpsb_destroy_hostinfo
(
hl
,
host
);
}
static
int
highlevel_for_each_host_unreg
(
struct
hpsb_host
*
host
,
void
*
__data
)
{
struct
hpsb_highlevel
*
hl
=
__data
;
hl
->
remove_host
(
host
);
hpsb_destroy_hostinfo
(
hl
,
host
);
__unregister_host
(
hl
,
host
);
return
0
;
}
void
hpsb_unregister_highlevel
(
struct
hpsb_highlevel
*
hl
)
{
struct
list_head
*
lh
,
*
next
;
struct
hpsb_address_serve
*
as
;
unsigned
long
flags
;
write_lock_irqsave
(
&
addr_space_lock
,
flags
);
list_for_each_safe
(
lh
,
next
,
&
hl
->
addr_list
)
{
as
=
list_entry
(
lh
,
struct
hpsb_address_serve
,
addr_list
);
list_del
(
&
as
->
as_list
);
kfree
(
as
);
}
write_unlock_irqrestore
(
&
addr_space_lock
,
flags
);
write_lock
(
&
hl_irqs_lock
);
list_del
(
&
hl
->
irq_list
);
write_unlock
(
&
hl_irqs_lock
);
...
...
@@ -293,8 +309,7 @@ void hpsb_unregister_highlevel(struct hpsb_highlevel *hl)
list_del
(
&
hl
->
hl_list
);
up_write
(
&
hl_drivers_sem
);
if
(
hl
->
remove_host
)
nodemgr_for_each_host
(
hl
,
highlevel_for_each_host_unreg
);
nodemgr_for_each_host
(
hl
,
highlevel_for_each_host_unreg
);
}
int
hpsb_register_addrspace
(
struct
hpsb_highlevel
*
hl
,
struct
hpsb_host
*
host
,
...
...
@@ -435,29 +450,11 @@ void highlevel_add_host(struct hpsb_host *host)
void
highlevel_remove_host
(
struct
hpsb_host
*
host
)
{
struct
hpsb_highlevel
*
hl
;
struct
list_head
*
lh
,
*
next
;
struct
hpsb_address_serve
*
as
;
unsigned
long
flags
;
down_read
(
&
hl_drivers_sem
);
list_for_each_entry
(
hl
,
&
hl_drivers
,
hl_list
)
{
if
(
hl
->
remove_host
)
{
hl
->
remove_host
(
host
);
hpsb_destroy_hostinfo
(
hl
,
host
);
}
}
list_for_each_entry
(
hl
,
&
hl_drivers
,
hl_list
)
__unregister_host
(
hl
,
host
);
up_read
(
&
hl_drivers_sem
);
/* Free up 1394 address space left behind by high level drivers. */
write_lock_irqsave
(
&
addr_space_lock
,
flags
);
list_for_each_safe
(
lh
,
next
,
&
host
->
addr_space
)
{
as
=
list_entry
(
lh
,
struct
hpsb_address_serve
,
as_list
);
if
(
!
list_empty
(
&
as
->
addr_list
))
{
list_del
(
&
as
->
addr_list
);
kfree
(
as
);
}
}
write_unlock_irqrestore
(
&
addr_space_lock
,
flags
);
}
void
highlevel_host_reset
(
struct
hpsb_host
*
host
)
...
...
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