From: Andrew Morton Cc: Alan Cox Cc: Dave Jones Cc: Bartlomiej Zolnierkiewicz Signed-off-by: Andrew Morton --- drivers/ide/pci/piix.c | 13 +++++++------ 1 files changed, 7 insertions(+), 6 deletions(-) diff -puN drivers/ide/pci/piix.c~fix-ide-locking-error-tidy drivers/ide/pci/piix.c --- devel/drivers/ide/pci/piix.c~fix-ide-locking-error-tidy 2006-02-17 00:08:18.000000000 -0800 +++ devel-akpm/drivers/ide/pci/piix.c 2006-02-17 00:08:18.000000000 -0800 @@ -204,8 +204,6 @@ static u8 piix_dma_2_pio (u8 xfer_rate) } } -static spinlock_t tune_lock = SPIN_LOCK_UNLOCKED; - /** * piix_tune_drive - tune a drive attached to a PIIX * @drive: drive to tune @@ -224,6 +222,8 @@ static void piix_tune_drive (ide_drive_t unsigned long flags; u16 master_data; u8 slave_data; + static DEFINE_SPINLOCK(tune_lock); + /* ISP RTC */ u8 timings[][2] = { { 0, 0 }, { 0, 0 }, @@ -233,10 +233,11 @@ static void piix_tune_drive (ide_drive_t pio = ide_get_best_pio_mode(drive, pio, 5, NULL); - /* Master v slave is synchronized above us but the slave register is - shared by the two hwifs so the corner case of two slave timeouts in - parallel must be locked */ - + /* + * Master vs slave is synchronized above us but the slave register is + * shared by the two hwifs so the corner case of two slave timeouts in + * parallel must be locked. + */ spin_lock_irqsave(&tune_lock, flags); pci_read_config_word(dev, master_port, &master_data); if (is_slave) { _