Skip to content

Commit 2e9d5e4

Browse files
Alex Chianglenb
authored andcommitted
ACPI: processor: export acpi_get_cpuid()
Rename static get_cpu_id() to acpi_get_cpuid() and export it. This change also gives us an opportunity to remove the #ifndef CONFIG_SMP from processor_driver.c and into a header file where it properly belongs. Acked-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Signed-off-by: Alex Chiang <achiang@hp.com> Signed-off-by: Len Brown <len.brown@intel.com>
1 parent 4d5d4cd commit 2e9d5e4

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

‎drivers/acpi/processor_driver.c‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -361,10 +361,7 @@ static inline int acpi_processor_remove_fs(struct acpi_device *device)
361361

362362
/* Use the acpiid in MADT to map cpus in case of SMP */
363363

364-
#ifndef CONFIG_SMP
365-
static int get_cpu_id(acpi_handle handle, int type, u32 acpi_id) { return -1; }
366-
#else
367-
364+
#ifdef CONFIG_SMP
368365
static struct acpi_table_madt *madt;
369366

370367
static int map_lapic_id(struct acpi_subtable_header *entry,
@@ -496,7 +493,7 @@ static int map_mat_entry(acpi_handle handle, int type, u32 acpi_id)
496493
return apic_id;
497494
}
498495

499-
static int get_cpu_id(acpi_handle handle, int type, u32 acpi_id)
496+
int acpi_get_cpuid(acpi_handle handle, int type, u32 acpi_id)
500497
{
501498
int i;
502499
int apic_id = -1;
@@ -513,6 +510,7 @@ static int get_cpu_id(acpi_handle handle, int type, u32 acpi_id)
513510
}
514511
return -1;
515512
}
513+
EXPORT_SYMBOL_GPL(acpi_get_cpuid);
516514
#endif
517515

518516
/* --------------------------------------------------------------------------
@@ -579,7 +577,7 @@ static int acpi_processor_get_info(struct acpi_device *device)
579577
device_declaration = 1;
580578
pr->acpi_id = value;
581579
}
582-
cpu_index = get_cpu_id(pr->handle, device_declaration, pr->acpi_id);
580+
cpu_index = acpi_get_cpuid(pr->handle, device_declaration, pr->acpi_id);
583581

584582
/* Handle UP system running SMP kernel, with no LAPIC in MADT */
585583
if (!cpu0_initialized && (cpu_index == -1) &&

‎include/acpi/processor.h‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,14 @@ static inline int acpi_processor_get_bios_limit(int cpu, unsigned int *limit)
322322

323323
/* in processor_core.c */
324324
void acpi_processor_set_pdc(acpi_handle handle);
325+
#ifdef CONFIG_SMP
326+
int acpi_get_cpuid(acpi_handle, int type, u32 acpi_id);
327+
#else
328+
static inline int acpi_get_cpuid(acpi_handle handle, int type, u32 acpi_id)
329+
{
330+
return -1;
331+
}
332+
#endif
325333

326334
/* in processor_throttling.c */
327335
int acpi_processor_tstate_has_changed(struct acpi_processor *pr);

0 commit comments

Comments
 (0)