login
Header Space

 
 

[PATCH] ide: remove IDE devices from /proc/ide/ before unregistering them

Previous thread: x86: not showing f00f bug correctly in /proc/cpuinfo by David Martin on Saturday, March 15, 2008 - 3:11 pm. (2 messages)

Next thread: GIT commit description flag(s) by Artem S. Tashkinov on Saturday, March 15, 2008 - 5:35 pm. (5 messages)
To: <linux-ide@...>
Cc: <linux-kernel@...>
Date: Saturday, March 15, 2008 - 5:27 pm

IDE devices need to be removed from /proc/ide/ _before_ being unregistered:

* Drop 'ide_hwif_t *hwif' argument from destroy_proc_ide_device()
  and use drive-&gt;hwif instead.

* Rename destroy_proc_ide_device() to ide_proc_unregister_device().

* Call ide_proc_unregister_device() in drive_release_dev().

* Remove no longer needed destroy_proc_ide_drives().

Signed-off-by: Bartlomiej Zolnierkiewicz &lt;bzolnier@gmail.com&gt;
---
goes before "ide: factor out code unregistering devices from ide_unregister()"
patch in IDE tree

 drivers/ide/ide-probe.c |    2 ++
 drivers/ide/ide-proc.c  |   16 ++--------------
 include/linux/ide.h     |    2 ++
 3 files changed, 6 insertions(+), 14 deletions(-)

Index: b/drivers/ide/ide-probe.c
===================================================================
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -1198,6 +1198,8 @@ static void drive_release_dev (struct de
 {
 	ide_drive_t *drive = container_of(dev, ide_drive_t, gendev);
 
+	ide_proc_unregister_device(drive);
+
 	spin_lock_irq(&amp;ide_lock);
 	ide_remove_drive_from_hwgroup(drive);
 	kfree(drive-&gt;id);
Index: b/drivers/ide/ide-proc.c
===================================================================
--- a/drivers/ide/ide-proc.c
+++ b/drivers/ide/ide-proc.c
@@ -764,27 +764,16 @@ void ide_proc_port_register_devices(ide_
 	}
 }
 
-static void destroy_proc_ide_device(ide_hwif_t *hwif, ide_drive_t *drive)
+void ide_proc_unregister_device(ide_drive_t *drive)
 {
 	if (drive-&gt;proc) {
 		ide_remove_proc_entries(drive-&gt;proc, generic_drive_entries);
 		remove_proc_entry(drive-&gt;name, proc_ide_root);
-		remove_proc_entry(drive-&gt;name, hwif-&gt;proc);
+		remove_proc_entry(drive-&gt;name, drive-&gt;hwif-&gt;proc);
 		drive-&gt;proc = NULL;
 	}
 }
 
-static void destroy_proc_ide_drives(ide_hwif_t *hwif)
-{
-	int	d;
-
-	for (d = 0; d &lt; MAX_DRIVES; d++) {
-		ide_drive_t *drive = &amp;hwif-&gt;drives[d];
-		if (drive-&gt;proc)
-			destroy_proc_ide_...
Previous thread: x86: not showing f00f bug correctly in /proc/cpuinfo by David Martin on Saturday, March 15, 2008 - 3:11 pm. (2 messages)

Next thread: GIT commit description flag(s) by Artem S. Tashkinov on Saturday, March 15, 2008 - 5:35 pm. (5 messages)
speck-geostationary