diff options
Diffstat (limited to 'arch/x86/platform/mrst/mrst.c')
-rw-r--r-- | arch/x86/platform/mrst/mrst.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/arch/x86/platform/mrst/mrst.c b/arch/x86/platform/mrst/mrst.c index 7000e74b3087..fe73276e026b 100644 --- a/arch/x86/platform/mrst/mrst.c +++ b/arch/x86/platform/mrst/mrst.c | |||
@@ -678,36 +678,40 @@ static int __init sfi_parse_devs(struct sfi_table_header *table) | |||
678 | pentry = (struct sfi_device_table_entry *)sb->pentry; | 678 | pentry = (struct sfi_device_table_entry *)sb->pentry; |
679 | 679 | ||
680 | for (i = 0; i < num; i++, pentry++) { | 680 | for (i = 0; i < num; i++, pentry++) { |
681 | if (pentry->irq != (u8)0xff) { /* native RTE case */ | 681 | int irq = pentry->irq; |
682 | |||
683 | if (irq != (u8)0xff) { /* native RTE case */ | ||
682 | /* these SPI2 devices are not exposed to system as PCI | 684 | /* these SPI2 devices are not exposed to system as PCI |
683 | * devices, but they have separate RTE entry in IOAPIC | 685 | * devices, but they have separate RTE entry in IOAPIC |
684 | * so we have to enable them one by one here | 686 | * so we have to enable them one by one here |
685 | */ | 687 | */ |
686 | ioapic = mp_find_ioapic(pentry->irq); | 688 | ioapic = mp_find_ioapic(irq); |
687 | irq_attr.ioapic = ioapic; | 689 | irq_attr.ioapic = ioapic; |
688 | irq_attr.ioapic_pin = pentry->irq; | 690 | irq_attr.ioapic_pin = irq; |
689 | irq_attr.trigger = 1; | 691 | irq_attr.trigger = 1; |
690 | irq_attr.polarity = 1; | 692 | irq_attr.polarity = 1; |
691 | io_apic_set_pci_routing(NULL, pentry->irq, &irq_attr); | 693 | io_apic_set_pci_routing(NULL, irq, &irq_attr); |
692 | } | 694 | } else |
695 | irq = 0; /* No irq */ | ||
696 | |||
693 | switch (pentry->type) { | 697 | switch (pentry->type) { |
694 | case SFI_DEV_TYPE_IPC: | 698 | case SFI_DEV_TYPE_IPC: |
695 | /* ID as IRQ is a hack that will go away */ | 699 | /* ID as IRQ is a hack that will go away */ |
696 | pdev = platform_device_alloc(pentry->name, pentry->irq); | 700 | pdev = platform_device_alloc(pentry->name, irq); |
697 | if (pdev == NULL) { | 701 | if (pdev == NULL) { |
698 | pr_err("out of memory for SFI platform device '%s'.\n", | 702 | pr_err("out of memory for SFI platform device '%s'.\n", |
699 | pentry->name); | 703 | pentry->name); |
700 | continue; | 704 | continue; |
701 | } | 705 | } |
702 | install_irq_resource(pdev, pentry->irq); | 706 | install_irq_resource(pdev, irq); |
703 | pr_debug("info[%2d]: IPC bus, name = %16.16s, " | 707 | pr_debug("info[%2d]: IPC bus, name = %16.16s, " |
704 | "irq = 0x%2x\n", i, pentry->name, pentry->irq); | 708 | "irq = 0x%2x\n", i, pentry->name, irq); |
705 | sfi_handle_ipc_dev(pdev); | 709 | sfi_handle_ipc_dev(pdev); |
706 | break; | 710 | break; |
707 | case SFI_DEV_TYPE_SPI: | 711 | case SFI_DEV_TYPE_SPI: |
708 | memset(&spi_info, 0, sizeof(spi_info)); | 712 | memset(&spi_info, 0, sizeof(spi_info)); |
709 | strncpy(spi_info.modalias, pentry->name, SFI_NAME_LEN); | 713 | strncpy(spi_info.modalias, pentry->name, SFI_NAME_LEN); |
710 | spi_info.irq = pentry->irq; | 714 | spi_info.irq = irq; |
711 | spi_info.bus_num = pentry->host_num; | 715 | spi_info.bus_num = pentry->host_num; |
712 | spi_info.chip_select = pentry->addr; | 716 | spi_info.chip_select = pentry->addr; |
713 | spi_info.max_speed_hz = pentry->max_freq; | 717 | spi_info.max_speed_hz = pentry->max_freq; |
@@ -724,7 +728,7 @@ static int __init sfi_parse_devs(struct sfi_table_header *table) | |||
724 | memset(&i2c_info, 0, sizeof(i2c_info)); | 728 | memset(&i2c_info, 0, sizeof(i2c_info)); |
725 | bus = pentry->host_num; | 729 | bus = pentry->host_num; |
726 | strncpy(i2c_info.type, pentry->name, SFI_NAME_LEN); | 730 | strncpy(i2c_info.type, pentry->name, SFI_NAME_LEN); |
727 | i2c_info.irq = pentry->irq; | 731 | i2c_info.irq = irq; |
728 | i2c_info.addr = pentry->addr; | 732 | i2c_info.addr = pentry->addr; |
729 | pr_debug("info[%2d]: I2C bus = %d, name = %16.16s, " | 733 | pr_debug("info[%2d]: I2C bus = %d, name = %16.16s, " |
730 | "irq = 0x%2x, addr = 0x%x\n", i, bus, | 734 | "irq = 0x%2x, addr = 0x%x\n", i, bus, |