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
6059143a
Commit
6059143a
authored
Jul 23, 2008
by
Bartlomiej Zolnierkiewicz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ide: move ide_remove_port_from_hwgroup() to ide-probe.c
Signed-off-by:
Bartlomiej Zolnierkiewicz
<
bzolnier@gmail.com
>
parent
8cdf3100
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
35 deletions
+35
-35
drivers/ide/ide-probe.c
drivers/ide/ide-probe.c
+35
-0
drivers/ide/ide.c
drivers/ide/ide.c
+0
-35
No files found.
drivers/ide/ide-probe.c
View file @
6059143a
...
...
@@ -992,6 +992,41 @@ static void ide_port_setup_devices(ide_hwif_t *hwif)
mutex_unlock
(
&
ide_cfg_mtx
);
}
void
ide_remove_port_from_hwgroup
(
ide_hwif_t
*
hwif
)
{
ide_hwgroup_t
*
hwgroup
=
hwif
->
hwgroup
;
spin_lock_irq
(
&
ide_lock
);
/*
* Remove us from the hwgroup, and free
* the hwgroup if we were the only member
*/
if
(
hwif
->
next
==
hwif
)
{
BUG_ON
(
hwgroup
->
hwif
!=
hwif
);
kfree
(
hwgroup
);
}
else
{
/* There is another interface in hwgroup.
* Unlink us, and set hwgroup->drive and ->hwif to
* something sane.
*/
ide_hwif_t
*
g
=
hwgroup
->
hwif
;
while
(
g
->
next
!=
hwif
)
g
=
g
->
next
;
g
->
next
=
hwif
->
next
;
if
(
hwgroup
->
hwif
==
hwif
)
{
/* Chose a random hwif for hwgroup->hwif.
* It's guaranteed that there are no drives
* left in the hwgroup.
*/
BUG_ON
(
hwgroup
->
drive
!=
NULL
);
hwgroup
->
hwif
=
g
;
}
BUG_ON
(
hwgroup
->
hwif
==
hwif
);
}
spin_unlock_irq
(
&
ide_lock
);
}
/*
* This routine sets up the irq for an ide interface, and creates a new
* hwgroup for the irq/hwif if none was previously assigned.
...
...
drivers/ide/ide.c
View file @
6059143a
...
...
@@ -133,41 +133,6 @@ static void ide_port_init_devices_data(ide_hwif_t *hwif)
}
}
void
ide_remove_port_from_hwgroup
(
ide_hwif_t
*
hwif
)
{
ide_hwgroup_t
*
hwgroup
=
hwif
->
hwgroup
;
spin_lock_irq
(
&
ide_lock
);
/*
* Remove us from the hwgroup, and free
* the hwgroup if we were the only member
*/
if
(
hwif
->
next
==
hwif
)
{
BUG_ON
(
hwgroup
->
hwif
!=
hwif
);
kfree
(
hwgroup
);
}
else
{
/* There is another interface in hwgroup.
* Unlink us, and set hwgroup->drive and ->hwif to
* something sane.
*/
ide_hwif_t
*
g
=
hwgroup
->
hwif
;
while
(
g
->
next
!=
hwif
)
g
=
g
->
next
;
g
->
next
=
hwif
->
next
;
if
(
hwgroup
->
hwif
==
hwif
)
{
/* Chose a random hwif for hwgroup->hwif.
* It's guaranteed that there are no drives
* left in the hwgroup.
*/
BUG_ON
(
hwgroup
->
drive
!=
NULL
);
hwgroup
->
hwif
=
g
;
}
BUG_ON
(
hwgroup
->
hwif
==
hwif
);
}
spin_unlock_irq
(
&
ide_lock
);
}
/* Called with ide_lock held. */
static
void
__ide_port_unregister_devices
(
ide_hwif_t
*
hwif
)
{
...
...
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