diff options
author | Sergei Shtylyov <sshtylyov@ru.mvista.com> | 2008-02-10 18:32:12 -0500 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-02-10 18:32:12 -0500 |
commit | d30a426dc5fd8801dbd05485788a001de623d487 (patch) | |
tree | 208b400c9d42ffef8a8ee811ef057f88fc28d623 /drivers/ide | |
parent | cb777922c3a15ccbea4c02bed401e030f195aaea (diff) |
ide: insert BUG_ON() into __ide_set_handler() (take 2)
Replace the check for hwgroup->handler and printk(KERN_CRIT, ...) at the start
of __ide_set_handler() with mere BUG_ON() while removing such from the caller,
ide_execute_command(). Fix up the code formatting, while at it...
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide')
-rw-r--r-- | drivers/ide/ide-iops.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c index c32e759df20..c419266234a 100644 --- a/drivers/ide/ide-iops.c +++ b/drivers/ide/ide-iops.c | |||
@@ -786,15 +786,11 @@ static void __ide_set_handler (ide_drive_t *drive, ide_handler_t *handler, | |||
786 | { | 786 | { |
787 | ide_hwgroup_t *hwgroup = HWGROUP(drive); | 787 | ide_hwgroup_t *hwgroup = HWGROUP(drive); |
788 | 788 | ||
789 | if (hwgroup->handler != NULL) { | 789 | BUG_ON(hwgroup->handler); |
790 | printk(KERN_CRIT "%s: ide_set_handler: handler not null; " | ||
791 | "old=%p, new=%p\n", | ||
792 | drive->name, hwgroup->handler, handler); | ||
793 | } | ||
794 | hwgroup->handler = handler; | 790 | hwgroup->handler = handler; |
795 | hwgroup->expiry = expiry; | 791 | hwgroup->expiry = expiry; |
796 | hwgroup->timer.expires = jiffies + timeout; | 792 | hwgroup->timer.expires = jiffies + timeout; |
797 | hwgroup->req_gen_timer = hwgroup->req_gen; | 793 | hwgroup->req_gen_timer = hwgroup->req_gen; |
798 | add_timer(&hwgroup->timer); | 794 | add_timer(&hwgroup->timer); |
799 | } | 795 | } |
800 | 796 | ||
@@ -827,11 +823,9 @@ void ide_execute_command(ide_drive_t *drive, u8 cmd, ide_handler_t *handler, | |||
827 | unsigned timeout, ide_expiry_t *expiry) | 823 | unsigned timeout, ide_expiry_t *expiry) |
828 | { | 824 | { |
829 | unsigned long flags; | 825 | unsigned long flags; |
830 | ide_hwgroup_t *hwgroup = HWGROUP(drive); | ||
831 | ide_hwif_t *hwif = HWIF(drive); | 826 | ide_hwif_t *hwif = HWIF(drive); |
832 | 827 | ||
833 | spin_lock_irqsave(&ide_lock, flags); | 828 | spin_lock_irqsave(&ide_lock, flags); |
834 | BUG_ON(hwgroup->handler); | ||
835 | __ide_set_handler(drive, handler, timeout, expiry); | 829 | __ide_set_handler(drive, handler, timeout, expiry); |
836 | hwif->OUTBSYNC(drive, cmd, IDE_COMMAND_REG); | 830 | hwif->OUTBSYNC(drive, cmd, IDE_COMMAND_REG); |
837 | /* | 831 | /* |