Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0947e0dcd62c15c67dba71561624d87b2d0cf131
Commit:     0947e0dcd62c15c67dba71561624d87b2d0cf131
Parent:     8a0e7e14a28b1084e90f8828d35530019c645969
Author:     Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Feb 2 19:56:41 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Feb 2 19:56:41 2008 +0100

    ide: factor out adding drive to hwgroup from init_irq()
    
    Factor out adding drive to hwgroup from init_irq() to
    ide_add_drive_to_hwgroup().
    
    There should be no functionality changes caused by this patch.
    
    Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/ide-probe.c |   29 ++++++++++++++++++-----------
 1 files changed, 18 insertions(+), 11 deletions(-)

diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index e7067c2..4d940d1 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -911,6 +911,23 @@ static int ide_init_queue(ide_drive_t *drive)
        return 0;
 }
 
+static void ide_add_drive_to_hwgroup(ide_drive_t *drive)
+{
+       ide_hwgroup_t *hwgroup = drive->hwif->hwgroup;
+
+       spin_lock_irq(&ide_lock);
+       if (!hwgroup->drive) {
+               /* first drive for hwgroup. */
+               drive->next = drive;
+               hwgroup->drive = drive;
+               hwgroup->hwif = HWIF(hwgroup->drive);
+       } else {
+               drive->next = hwgroup->drive->next;
+               hwgroup->drive->next = drive;
+       }
+       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.
@@ -1033,17 +1050,7 @@ static int init_irq (ide_hwif_t *hwif)
                        printk(KERN_ERR "ide: failed to init %s\n",drive->name);
                        continue;
                }
-               spin_lock_irq(&ide_lock);
-               if (!hwgroup->drive) {
-                       /* first drive for hwgroup. */
-                       drive->next = drive;
-                       hwgroup->drive = drive;
-                       hwgroup->hwif = HWIF(hwgroup->drive);
-               } else {
-                       drive->next = hwgroup->drive->next;
-                       hwgroup->drive->next = drive;
-               }
-               spin_unlock_irq(&ide_lock);
+               ide_add_drive_to_hwgroup(drive);
        }
 
 #if !defined(__mc68000__) && !defined(CONFIG_APUS)
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to