aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergei Shtylyov <sshtylyov@ru.mvista.com>2010-05-11 03:08:03 -0400
committerDavid S. Miller <davem@davemloft.net>2010-05-11 03:08:03 -0400
commita9ddabc52ce3757a4331d6c1e8bf4065333cc51b (patch)
tree3ed67e857fe0b729aed9b466ea5827e9c8e0114a
parentf693be4d8a00431b53a59d74aefdb3f7ae92f662 (diff)
cmd640: fix kernel oops in test_irq() method
When implementing the test_iqr() method, I forgot that this driver is not an ordinary PCI driver and also needs to support VLB variant of the chip. Moreover, 'hwif->dev' should be NULL, potentially causing oops in pci_read_config_byte(). Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/ide/cmd640.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/ide/cmd640.c b/drivers/ide/cmd640.c
index d2b8b272bc27..cb10201a15ed 100644
--- a/drivers/ide/cmd640.c
+++ b/drivers/ide/cmd640.c
@@ -633,12 +633,10 @@ static void __init cmd640_init_dev(ide_drive_t *drive)
633 633
634static int cmd640_test_irq(ide_hwif_t *hwif) 634static int cmd640_test_irq(ide_hwif_t *hwif)
635{ 635{
636 struct pci_dev *dev = to_pci_dev(hwif->dev);
637 int irq_reg = hwif->channel ? ARTTIM23 : CFR; 636 int irq_reg = hwif->channel ? ARTTIM23 : CFR;
638 u8 irq_stat, irq_mask = hwif->channel ? ARTTIM23_IDE23INTR : 637 u8 irq_mask = hwif->channel ? ARTTIM23_IDE23INTR :
639 CFR_IDE01INTR; 638 CFR_IDE01INTR;
640 639 u8 irq_stat = get_cmd640_reg(irq_reg);
641 pci_read_config_byte(dev, irq_reg, &irq_stat);
642 640
643 return (irq_stat & irq_mask) ? 1 : 0; 641 return (irq_stat & irq_mask) ? 1 : 0;
644} 642}