diff options
-rw-r--r-- | drivers/ata/pata_hpt37x.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/ata/pata_hpt37x.c b/drivers/ata/pata_hpt37x.c index c79f066c2bc9..68eb34929cec 100644 --- a/drivers/ata/pata_hpt37x.c +++ b/drivers/ata/pata_hpt37x.c | |||
@@ -847,15 +847,16 @@ static u32 hpt374_read_freq(struct pci_dev *pdev) | |||
847 | u32 freq; | 847 | u32 freq; |
848 | unsigned long io_base = pci_resource_start(pdev, 4); | 848 | unsigned long io_base = pci_resource_start(pdev, 4); |
849 | if (PCI_FUNC(pdev->devfn) & 1) { | 849 | if (PCI_FUNC(pdev->devfn) & 1) { |
850 | struct pci_dev *pdev_0 = pci_get_slot(pdev->bus, pdev->devfn - 1); | 850 | struct pci_dev *pdev_0; |
851 | |||
852 | pdev_0 = pci_get_slot(pdev->bus, pdev->devfn - 1); | ||
851 | /* Someone hot plugged the controller on us ? */ | 853 | /* Someone hot plugged the controller on us ? */ |
852 | if (pdev_0 == NULL) | 854 | if (pdev_0 == NULL) |
853 | return 0; | 855 | return 0; |
854 | io_base = pci_resource_start(pdev_0, 4); | 856 | io_base = pci_resource_start(pdev_0, 4); |
855 | freq = inl(io_base + 0x90); | 857 | freq = inl(io_base + 0x90); |
856 | pci_dev_put(pdev_0); | 858 | pci_dev_put(pdev_0); |
857 | } | 859 | } else |
858 | else | ||
859 | freq = inl(io_base + 0x90); | 860 | freq = inl(io_base + 0x90); |
860 | return freq; | 861 | return freq; |
861 | } | 862 | } |