diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-07-23 13:55:58 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-07-23 13:55:58 -0400 |
commit | 6059143ae34f30bb49ec8733468315284f78e2da (patch) | |
tree | c891300d24bb78664464e44a3924293c6c85a5c1 /drivers/ide/ide.c | |
parent | 8cdf310025bff8c5ef78564f525a8f347952237b (diff) |
ide: move ide_remove_port_from_hwgroup() to ide-probe.c
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide.c')
-rw-r--r-- | drivers/ide/ide.c | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index 7e9575d1aee3..60c5db1c59e5 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c | |||
@@ -133,41 +133,6 @@ static void ide_port_init_devices_data(ide_hwif_t *hwif) | |||
133 | } | 133 | } |
134 | } | 134 | } |
135 | 135 | ||
136 | void ide_remove_port_from_hwgroup(ide_hwif_t *hwif) | ||
137 | { | ||
138 | ide_hwgroup_t *hwgroup = hwif->hwgroup; | ||
139 | |||
140 | spin_lock_irq(&ide_lock); | ||
141 | /* | ||
142 | * Remove us from the hwgroup, and free | ||
143 | * the hwgroup if we were the only member | ||
144 | */ | ||
145 | if (hwif->next == hwif) { | ||
146 | BUG_ON(hwgroup->hwif != hwif); | ||
147 | kfree(hwgroup); | ||
148 | } else { | ||
149 | /* There is another interface in hwgroup. | ||
150 | * Unlink us, and set hwgroup->drive and ->hwif to | ||
151 | * something sane. | ||
152 | */ | ||
153 | ide_hwif_t *g = hwgroup->hwif; | ||
154 | |||
155 | while (g->next != hwif) | ||
156 | g = g->next; | ||
157 | g->next = hwif->next; | ||
158 | if (hwgroup->hwif == hwif) { | ||
159 | /* Chose a random hwif for hwgroup->hwif. | ||
160 | * It's guaranteed that there are no drives | ||
161 | * left in the hwgroup. | ||
162 | */ | ||
163 | BUG_ON(hwgroup->drive != NULL); | ||
164 | hwgroup->hwif = g; | ||
165 | } | ||
166 | BUG_ON(hwgroup->hwif == hwif); | ||
167 | } | ||
168 | spin_unlock_irq(&ide_lock); | ||
169 | } | ||
170 | |||
171 | /* Called with ide_lock held. */ | 136 | /* Called with ide_lock held. */ |
172 | static void __ide_port_unregister_devices(ide_hwif_t *hwif) | 137 | static void __ide_port_unregister_devices(ide_hwif_t *hwif) |
173 | { | 138 | { |