aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-12-29 14:27:38 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-12-29 14:27:38 -0500
commit94b9efdf5a3ec78bc31281ea3ba80028ce4ab057 (patch)
treea9c0e2ebcaca395792c5ea43d1d61b83ab2787b4
parentd688b72c90a7faf13c070d4ebb63cacdf481de32 (diff)
ide: push local_irq_{save,restore}() to do_identify()
Push local_irq_{save,restore}() from actual_try_to_identify() to do_identify() and remove no longer needed local_irq_enable(). Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
-rw-r--r--drivers/ide/ide-probe.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index 2333a5a83519..a64ec259f3d1 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -116,14 +116,16 @@ static void do_identify(ide_drive_t *drive, u8 cmd)
116 ide_hwif_t *hwif = HWIF(drive); 116 ide_hwif_t *hwif = HWIF(drive);
117 u16 *id = drive->id; 117 u16 *id = drive->id;
118 char *m = (char *)&id[ATA_ID_PROD]; 118 char *m = (char *)&id[ATA_ID_PROD];
119 unsigned long flags;
119 int bswap = 1, is_cfa; 120 int bswap = 1, is_cfa;
120 121
122 /* local CPU only; some systems need this */
123 local_irq_save(flags);
121 /* read 512 bytes of id info */ 124 /* read 512 bytes of id info */
122 hwif->tp_ops->input_data(drive, NULL, id, SECTOR_SIZE); 125 hwif->tp_ops->input_data(drive, NULL, id, SECTOR_SIZE);
126 local_irq_restore(flags);
123 127
124 drive->dev_flags |= IDE_DFLAG_ID_READ; 128 drive->dev_flags |= IDE_DFLAG_ID_READ;
125
126 local_irq_enable();
127#ifdef DEBUG 129#ifdef DEBUG
128 printk(KERN_INFO "%s: dumping identify data\n", drive->name); 130 printk(KERN_INFO "%s: dumping identify data\n", drive->name);
129 ide_dump_identify((u8 *)id); 131 ide_dump_identify((u8 *)id);
@@ -306,17 +308,12 @@ static int actual_try_to_identify (ide_drive_t *drive, u8 cmd)
306 s = tp_ops->read_status(hwif); 308 s = tp_ops->read_status(hwif);
307 309
308 if (OK_STAT(s, ATA_DRQ, BAD_R_STAT)) { 310 if (OK_STAT(s, ATA_DRQ, BAD_R_STAT)) {
309 unsigned long flags;
310
311 /* local CPU only; some systems need this */
312 local_irq_save(flags);
313 /* drive returned ID */ 311 /* drive returned ID */
314 do_identify(drive, cmd); 312 do_identify(drive, cmd);
315 /* drive responded with ID */ 313 /* drive responded with ID */
316 rc = 0; 314 rc = 0;
317 /* clear drive IRQ */ 315 /* clear drive IRQ */
318 (void)tp_ops->read_status(hwif); 316 (void)tp_ops->read_status(hwif);
319 local_irq_restore(flags);
320 } else { 317 } else {
321 /* drive refused ID */ 318 /* drive refused ID */
322 rc = 2; 319 rc = 2;