Skip to content

Commit bd23fac

Browse files
Sinan Kayarafaeljw
authored andcommitted
ACPICA: Remove PCI bits from ACPICA when CONFIG_PCI is unset
Allow ACPI to be built without PCI support in place. Signed-off-by: Sinan Kaya <okaya@kernel.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 8668977 commit bd23fac

6 files changed

Lines changed: 24 additions & 5 deletions

File tree

‎drivers/acpi/acpica/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,13 @@ acpi-y += \
7777
hwacpi.o \
7878
hwesleep.o \
7979
hwgpe.o \
80-
hwpci.o \
8180
hwregs.o \
8281
hwsleep.o \
8382
hwvalid.o \
8483
hwxface.o \
8584
hwxfsleep.o
8685

86+
acpi-$(CONFIG_PCI) += hwpci.o
8787
acpi-$(ACPI_FUTURE_USAGE) += hwtimer.o
8888

8989
acpi-y += \

‎drivers/acpi/acpica/achware.h‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,20 @@ acpi_hw_enable_runtime_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
106106
struct acpi_gpe_block_info *gpe_block,
107107
void *context);
108108

109+
#ifdef ACPI_PCI_CONFIGURED
109110
/*
110111
* hwpci - PCI configuration support
111112
*/
112113
acpi_status
113114
acpi_hw_derive_pci_id(struct acpi_pci_id *pci_id,
114115
acpi_handle root_pci_device, acpi_handle pci_region);
116+
#else
117+
static inline acpi_status
118+
acpi_hw_derive_pci_id(struct acpi_pci_id *pci_id, acpi_handle root_pci_device,
119+
acpi_handle pci_region)
120+
{
121+
return AE_SUPPORT;
122+
}
123+
#endif
115124

116125
#endif /* __ACHWARE_H__ */

‎drivers/acpi/acpica/evhandler.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -364,25 +364,25 @@ acpi_ev_install_space_handler(struct acpi_namespace_node *node,
364364
handler = acpi_ex_system_io_space_handler;
365365
setup = acpi_ev_io_space_region_setup;
366366
break;
367-
367+
#ifdef ACPI_PCI_CONFIGURED
368368
case ACPI_ADR_SPACE_PCI_CONFIG:
369369

370370
handler = acpi_ex_pci_config_space_handler;
371371
setup = acpi_ev_pci_config_region_setup;
372372
break;
373-
373+
#endif
374374
case ACPI_ADR_SPACE_CMOS:
375375

376376
handler = acpi_ex_cmos_space_handler;
377377
setup = acpi_ev_cmos_region_setup;
378378
break;
379-
379+
#ifdef ACPI_PCI_CONFIGURED
380380
case ACPI_ADR_SPACE_PCI_BAR_TARGET:
381381

382382
handler = acpi_ex_pci_bar_space_handler;
383383
setup = acpi_ev_pci_bar_region_setup;
384384
break;
385-
385+
#endif
386386
case ACPI_ADR_SPACE_DATA_TABLE:
387387

388388
handler = acpi_ex_data_table_space_handler;

‎drivers/acpi/acpica/exregion.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,7 @@ acpi_ex_system_io_space_handler(u32 function,
311311
return_ACPI_STATUS(status);
312312
}
313313

314+
#ifdef ACPI_PCI_CONFIGURED
314315
/*******************************************************************************
315316
*
316317
* FUNCTION: acpi_ex_pci_config_space_handler
@@ -387,6 +388,7 @@ acpi_ex_pci_config_space_handler(u32 function,
387388

388389
return_ACPI_STATUS(status);
389390
}
391+
#endif
390392

391393
/*******************************************************************************
392394
*
@@ -420,6 +422,7 @@ acpi_ex_cmos_space_handler(u32 function,
420422
return_ACPI_STATUS(status);
421423
}
422424

425+
#ifdef ACPI_PCI_CONFIGURED
423426
/*******************************************************************************
424427
*
425428
* FUNCTION: acpi_ex_pci_bar_space_handler
@@ -451,6 +454,7 @@ acpi_ex_pci_bar_space_handler(u32 function,
451454

452455
return_ACPI_STATUS(status);
453456
}
457+
#endif
454458

455459
/*******************************************************************************
456460
*

‎drivers/acpi/osl.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,7 @@ acpi_os_write_memory(acpi_physical_address phys_addr, u64 value, u32 width)
769769
return AE_OK;
770770
}
771771

772+
#ifdef CONFIG_PCI
772773
acpi_status
773774
acpi_os_read_pci_configuration(struct acpi_pci_id * pci_id, u32 reg,
774775
u64 *value, u32 width)
@@ -827,6 +828,7 @@ acpi_os_write_pci_configuration(struct acpi_pci_id * pci_id, u32 reg,
827828

828829
return (result ? AE_ERROR : AE_OK);
829830
}
831+
#endif
830832

831833
static void acpi_os_execute_deferred(struct work_struct *work)
832834
{

‎include/acpi/platform/aclinux.h‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@
3333

3434
/* Kernel specific ACPICA configuration */
3535

36+
#ifdef CONFIG_PCI
37+
#define ACPI_PCI_CONFIGURED
38+
#endif
39+
3640
#ifdef CONFIG_ACPI_REDUCED_HARDWARE_ONLY
3741
#define ACPI_REDUCED_HARDWARE 1
3842
#endif

0 commit comments

Comments
 (0)