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
d414b921
Commit
d414b921
authored
Jun 26, 2003
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] PCI Hotplug: cpci: fix delete bug and add release() callback
parent
e3bbd7e4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
6 deletions
+16
-6
drivers/pci/hotplug/cpci_hotplug_core.c
drivers/pci/hotplug/cpci_hotplug_core.c
+16
-6
No files found.
drivers/pci/hotplug/cpci_hotplug_core.c
View file @
d414b921
...
@@ -278,6 +278,19 @@ get_adapter_status(struct hotplug_slot *hotplug_slot, u8 * value)
...
@@ -278,6 +278,19 @@ get_adapter_status(struct hotplug_slot *hotplug_slot, u8 * value)
return
0
;
return
0
;
}
}
static
void
release_slot
(
struct
hotplug_slot
*
hotplug_slot
)
{
struct
slot
*
slot
=
get_slot
(
hotplug_slot
,
__FUNCTION__
);
if
(
slot
==
NULL
)
return
;
kfree
(
slot
->
hotplug_slot
->
info
);
kfree
(
slot
->
hotplug_slot
->
name
);
kfree
(
slot
->
hotplug_slot
);
kfree
(
slot
);
}
#define SLOT_NAME_SIZE 6
#define SLOT_NAME_SIZE 6
static
void
static
void
make_slot_name
(
struct
slot
*
slot
)
make_slot_name
(
struct
slot
*
slot
)
...
@@ -346,6 +359,7 @@ cpci_hp_register_bus(struct pci_bus *bus, u8 first, u8 last)
...
@@ -346,6 +359,7 @@ cpci_hp_register_bus(struct pci_bus *bus, u8 first, u8 last)
slot
->
devfn
=
PCI_DEVFN
(
i
,
0
);
slot
->
devfn
=
PCI_DEVFN
(
i
,
0
);
hotplug_slot
->
private
=
slot
;
hotplug_slot
->
private
=
slot
;
hotplug_slot
->
release
=
&
release_slot
;
make_slot_name
(
slot
);
make_slot_name
(
slot
);
hotplug_slot
->
ops
=
&
cpci_hotplug_slot_ops
;
hotplug_slot
->
ops
=
&
cpci_hotplug_slot_ops
;
...
@@ -382,6 +396,7 @@ cpci_hp_unregister_bus(struct pci_bus *bus)
...
@@ -382,6 +396,7 @@ cpci_hp_unregister_bus(struct pci_bus *bus)
{
{
struct
slot
*
slot
;
struct
slot
*
slot
;
struct
list_head
*
tmp
;
struct
list_head
*
tmp
;
struct
list_head
*
next
;
int
status
;
int
status
;
if
(
!
bus
)
{
if
(
!
bus
)
{
...
@@ -393,7 +408,7 @@ cpci_hp_unregister_bus(struct pci_bus *bus)
...
@@ -393,7 +408,7 @@ cpci_hp_unregister_bus(struct pci_bus *bus)
spin_unlock
(
&
list_lock
);
spin_unlock
(
&
list_lock
);
return
-
1
;
return
-
1
;
}
}
list_for_each
(
tmp
,
&
slot_list
)
{
list_for_each
_safe
(
tmp
,
next
,
&
slot_list
)
{
slot
=
list_entry
(
tmp
,
struct
slot
,
slot_list
);
slot
=
list_entry
(
tmp
,
struct
slot
,
slot_list
);
if
(
slot
->
bus
==
bus
)
{
if
(
slot
->
bus
==
bus
)
{
dbg
(
"deregistering slot %s"
,
slot
->
hotplug_slot
->
name
);
dbg
(
"deregistering slot %s"
,
slot
->
hotplug_slot
->
name
);
...
@@ -405,11 +420,6 @@ cpci_hp_unregister_bus(struct pci_bus *bus)
...
@@ -405,11 +420,6 @@ cpci_hp_unregister_bus(struct pci_bus *bus)
}
}
list_del
(
&
slot
->
slot_list
);
list_del
(
&
slot
->
slot_list
);
kfree
(
slot
->
hotplug_slot
->
info
);
kfree
(
slot
->
hotplug_slot
->
name
);
kfree
(
slot
->
hotplug_slot
);
kfree
(
slot
);
slots
--
;
slots
--
;
}
}
}
}
...
...
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