diff options
Diffstat (limited to 'drivers/misc/hpilo.c')
-rw-r--r-- | drivers/misc/hpilo.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/misc/hpilo.c b/drivers/misc/hpilo.c index d6a901cd4222..fea8ff40440f 100644 --- a/drivers/misc/hpilo.c +++ b/drivers/misc/hpilo.c | |||
@@ -688,7 +688,8 @@ static void ilo_unmap_device(struct pci_dev *pdev, struct ilo_hwinfo *hw) | |||
688 | 688 | ||
689 | static int ilo_map_device(struct pci_dev *pdev, struct ilo_hwinfo *hw) | 689 | static int ilo_map_device(struct pci_dev *pdev, struct ilo_hwinfo *hw) |
690 | { | 690 | { |
691 | int error = -ENOMEM; | 691 | int bar; |
692 | unsigned long off; | ||
692 | 693 | ||
693 | /* map the memory mapped i/o registers */ | 694 | /* map the memory mapped i/o registers */ |
694 | hw->mmio_vaddr = pci_iomap(pdev, 1, 0); | 695 | hw->mmio_vaddr = pci_iomap(pdev, 1, 0); |
@@ -698,7 +699,15 @@ static int ilo_map_device(struct pci_dev *pdev, struct ilo_hwinfo *hw) | |||
698 | } | 699 | } |
699 | 700 | ||
700 | /* map the adapter shared memory region */ | 701 | /* map the adapter shared memory region */ |
701 | hw->ram_vaddr = pci_iomap(pdev, 2, max_ccb * ILOHW_CCB_SZ); | 702 | if (pdev->subsystem_device == 0x00E4) { |
703 | bar = 5; | ||
704 | /* Last 8k is reserved for CCBs */ | ||
705 | off = pci_resource_len(pdev, bar) - 0x2000; | ||
706 | } else { | ||
707 | bar = 2; | ||
708 | off = 0; | ||
709 | } | ||
710 | hw->ram_vaddr = pci_iomap_range(pdev, bar, off, max_ccb * ILOHW_CCB_SZ); | ||
702 | if (hw->ram_vaddr == NULL) { | 711 | if (hw->ram_vaddr == NULL) { |
703 | dev_err(&pdev->dev, "Error mapping shared mem\n"); | 712 | dev_err(&pdev->dev, "Error mapping shared mem\n"); |
704 | goto mmio_free; | 713 | goto mmio_free; |
@@ -717,7 +726,7 @@ ram_free: | |||
717 | mmio_free: | 726 | mmio_free: |
718 | pci_iounmap(pdev, hw->mmio_vaddr); | 727 | pci_iounmap(pdev, hw->mmio_vaddr); |
719 | out: | 728 | out: |
720 | return error; | 729 | return -ENOMEM; |
721 | } | 730 | } |
722 | 731 | ||
723 | static void ilo_remove(struct pci_dev *pdev) | 732 | static void ilo_remove(struct pci_dev *pdev) |
@@ -899,7 +908,7 @@ static void __exit ilo_exit(void) | |||
899 | class_destroy(ilo_class); | 908 | class_destroy(ilo_class); |
900 | } | 909 | } |
901 | 910 | ||
902 | MODULE_VERSION("1.4.1"); | 911 | MODULE_VERSION("1.5.0"); |
903 | MODULE_ALIAS(ILO_NAME); | 912 | MODULE_ALIAS(ILO_NAME); |
904 | MODULE_DESCRIPTION(ILO_NAME); | 913 | MODULE_DESCRIPTION(ILO_NAME); |
905 | MODULE_AUTHOR("David Altobelli <david.altobelli@hpe.com>"); | 914 | MODULE_AUTHOR("David Altobelli <david.altobelli@hpe.com>"); |