mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
Drivers: hv: vmbus: Remove x86-isms from arch independent drivers
hv_is_hypercall_page_setup() is used to check if Hyper-V is initialized, but a 'hypercall page' is an x86 implementation detail that isn't necessarily present on other architectures. Rename to the architecture independent hv_is_hyperv_initialized() and add check that x86_hyper is pointing to Hyper-V. Use this function instead of direct references to x86-specific data structures in vmbus_drv.c, and remove now redundant call in hv_init(). Also remove 'x86' from the string name passed to cpuhp_setup_state(). Signed-off-by: Michael Kelley <[email protected]> Signed-off-by: K. Y. Srinivasan <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
f5cb779ba1
commit
4a5f3cde4d
4 changed files with 18 additions and 15 deletions
|
|
@ -49,9 +49,6 @@ struct hv_context hv_context = {
|
|||
*/
|
||||
int hv_init(void)
|
||||
{
|
||||
if (!hv_is_hypercall_page_setup())
|
||||
return -ENOTSUPP;
|
||||
|
||||
hv_context.cpu_context = alloc_percpu(struct hv_per_cpu_context);
|
||||
if (!hv_context.cpu_context)
|
||||
return -ENOMEM;
|
||||
|
|
|
|||
|
|
@ -37,7 +37,6 @@
|
|||
#include <linux/sched/task_stack.h>
|
||||
|
||||
#include <asm/hyperv.h>
|
||||
#include <asm/hypervisor.h>
|
||||
#include <asm/mshyperv.h>
|
||||
#include <linux/notifier.h>
|
||||
#include <linux/ptrace.h>
|
||||
|
|
@ -1053,7 +1052,7 @@ static int vmbus_bus_init(void)
|
|||
* Initialize the per-cpu interrupt state and
|
||||
* connect to the host.
|
||||
*/
|
||||
ret = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "x86/hyperv:online",
|
||||
ret = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "hyperv/vmbus:online",
|
||||
hv_synic_init, hv_synic_cleanup);
|
||||
if (ret < 0)
|
||||
goto err_alloc;
|
||||
|
|
@ -1717,7 +1716,7 @@ static int __init hv_acpi_init(void)
|
|||
{
|
||||
int ret, t;
|
||||
|
||||
if (x86_hyper_type != X86_HYPER_MS_HYPERV)
|
||||
if (!hv_is_hyperv_initialized())
|
||||
return -ENODEV;
|
||||
|
||||
init_completion(&probe_event);
|
||||
|
|
|
|||
Loading…
Reference in a new issue