diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-02-02 13:56:41 -0500 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-02-02 13:56:41 -0500 |
commit | d5bc6592df85dbbb300e0d62af89645602c97551 (patch) | |
tree | 26dba4b9a7277a819fdee1216ea06c08ec7b2226 | |
parent | 0947e0dcd62c15c67dba71561624d87b2d0cf131 (diff) |
ide: factor out devices setup from init_irq()
* Factor out devices setup from init_irq() to ide_port_setup_devices().
While at it:
* Do devices setup after printing port information.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
-rw-r--r-- | drivers/ide/ide-probe.c | 44 |
1 files changed, 28 insertions, 16 deletions
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index 4d940d1a80ed..91c352c82725 100644 --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c | |||
@@ -929,6 +929,31 @@ static void ide_add_drive_to_hwgroup(ide_drive_t *drive) | |||
929 | } | 929 | } |
930 | 930 | ||
931 | /* | 931 | /* |
932 | * For any present drive: | ||
933 | * - allocate the block device queue | ||
934 | * - link drive into the hwgroup | ||
935 | */ | ||
936 | static void ide_port_setup_devices(ide_hwif_t *hwif) | ||
937 | { | ||
938 | int i; | ||
939 | |||
940 | for (i = 0; i < MAX_DRIVES; i++) { | ||
941 | ide_drive_t *drive = &hwif->drives[i]; | ||
942 | |||
943 | if (!drive->present) | ||
944 | continue; | ||
945 | |||
946 | if (ide_init_queue(drive)) { | ||
947 | printk(KERN_ERR "ide: failed to init %s\n", | ||
948 | drive->name); | ||
949 | continue; | ||
950 | } | ||
951 | |||
952 | ide_add_drive_to_hwgroup(drive); | ||
953 | } | ||
954 | } | ||
955 | |||
956 | /* | ||
932 | * This routine sets up the irq for an ide interface, and creates a new | 957 | * This routine sets up the irq for an ide interface, and creates a new |
933 | * hwgroup for the irq/hwif if none was previously assigned. | 958 | * hwgroup for the irq/hwif if none was previously assigned. |
934 | * | 959 | * |
@@ -1037,22 +1062,6 @@ static int init_irq (ide_hwif_t *hwif) | |||
1037 | hwif->rqsize = 65536; | 1062 | hwif->rqsize = 65536; |
1038 | } | 1063 | } |
1039 | 1064 | ||
1040 | /* | ||
1041 | * For any present drive: | ||
1042 | * - allocate the block device queue | ||
1043 | * - link drive into the hwgroup | ||
1044 | */ | ||
1045 | for (index = 0; index < MAX_DRIVES; ++index) { | ||
1046 | ide_drive_t *drive = &hwif->drives[index]; | ||
1047 | if (!drive->present) | ||
1048 | continue; | ||
1049 | if (ide_init_queue(drive)) { | ||
1050 | printk(KERN_ERR "ide: failed to init %s\n",drive->name); | ||
1051 | continue; | ||
1052 | } | ||
1053 | ide_add_drive_to_hwgroup(drive); | ||
1054 | } | ||
1055 | |||
1056 | #if !defined(__mc68000__) && !defined(CONFIG_APUS) | 1065 | #if !defined(__mc68000__) && !defined(CONFIG_APUS) |
1057 | printk("%s at 0x%03lx-0x%03lx,0x%03lx on irq %d", hwif->name, | 1066 | printk("%s at 0x%03lx-0x%03lx,0x%03lx on irq %d", hwif->name, |
1058 | hwif->io_ports[IDE_DATA_OFFSET], | 1067 | hwif->io_ports[IDE_DATA_OFFSET], |
@@ -1066,6 +1075,9 @@ static int init_irq (ide_hwif_t *hwif) | |||
1066 | printk(" (%sed with %s)", | 1075 | printk(" (%sed with %s)", |
1067 | hwif->sharing_irq ? "shar" : "serializ", match->name); | 1076 | hwif->sharing_irq ? "shar" : "serializ", match->name); |
1068 | printk("\n"); | 1077 | printk("\n"); |
1078 | |||
1079 | ide_port_setup_devices(hwif); | ||
1080 | |||
1069 | mutex_unlock(&ide_cfg_mtx); | 1081 | mutex_unlock(&ide_cfg_mtx); |
1070 | return 0; | 1082 | return 0; |
1071 | out_unlink: | 1083 | out_unlink: |