@@ -45,7 +45,8 @@ struct vmbus_dynid {
45
45
struct hv_vmbus_device_id id ;
46
46
};
47
47
48
- static struct device * hv_dev ;
48
+ /* VMBus Root Device */
49
+ static struct device * vmbus_root_device ;
49
50
50
51
static int hyperv_cpuhp_online ;
51
52
@@ -80,9 +81,15 @@ static struct resource *fb_mmio;
80
81
static struct resource * hyperv_mmio ;
81
82
static DEFINE_MUTEX (hyperv_mmio_lock );
82
83
84
+ struct device * hv_get_vmbus_root_device (void )
85
+ {
86
+ return vmbus_root_device ;
87
+ }
88
+ EXPORT_SYMBOL_GPL (hv_get_vmbus_root_device );
89
+
83
90
static int vmbus_exists (void )
84
91
{
85
- if (hv_dev == NULL )
92
+ if (vmbus_root_device == NULL )
86
93
return - ENODEV ;
87
94
88
95
return 0 ;
@@ -861,7 +868,7 @@ static int vmbus_dma_configure(struct device *child_device)
861
868
* On x86/x64 coherence is assumed and these calls have no effect.
862
869
*/
863
870
hv_setup_dma_ops (child_device ,
864
- device_get_dma_attr (hv_dev ) == DEV_DMA_COHERENT );
871
+ device_get_dma_attr (vmbus_root_device ) == DEV_DMA_COHERENT );
865
872
return 0 ;
866
873
}
867
874
@@ -2037,7 +2044,7 @@ int vmbus_device_register(struct hv_device *child_device_obj)
2037
2044
& child_device_obj -> channel -> offermsg .offer .if_instance );
2038
2045
2039
2046
child_device_obj -> device .bus = & hv_bus ;
2040
- child_device_obj -> device .parent = hv_dev ;
2047
+ child_device_obj -> device .parent = vmbus_root_device ;
2041
2048
child_device_obj -> device .release = vmbus_device_release ;
2042
2049
2043
2050
child_device_obj -> device .dma_parms = & child_device_obj -> dma_parms ;
@@ -2412,7 +2419,7 @@ static int vmbus_acpi_add(struct platform_device *pdev)
2412
2419
struct acpi_device * ancestor ;
2413
2420
struct acpi_device * device = ACPI_COMPANION (& pdev -> dev );
2414
2421
2415
- hv_dev = & device -> dev ;
2422
+ vmbus_root_device = & device -> dev ;
2416
2423
2417
2424
/*
2418
2425
* Older versions of Hyper-V for ARM64 fail to include the _CCA
@@ -2498,7 +2505,7 @@ static int vmbus_device_add(struct platform_device *pdev)
2498
2505
struct device_node * np = pdev -> dev .of_node ;
2499
2506
int ret ;
2500
2507
2501
- hv_dev = & pdev -> dev ;
2508
+ vmbus_root_device = & pdev -> dev ;
2502
2509
2503
2510
ret = of_range_parser_init (& parser , np );
2504
2511
if (ret )
@@ -2816,7 +2823,7 @@ static int __init hv_acpi_init(void)
2816
2823
if (ret )
2817
2824
return ret ;
2818
2825
2819
- if (!hv_dev ) {
2826
+ if (!vmbus_root_device ) {
2820
2827
ret = - ENODEV ;
2821
2828
goto cleanup ;
2822
2829
}
@@ -2847,7 +2854,7 @@ static int __init hv_acpi_init(void)
2847
2854
2848
2855
cleanup :
2849
2856
platform_driver_unregister (& vmbus_platform_driver );
2850
- hv_dev = NULL ;
2857
+ vmbus_root_device = NULL ;
2851
2858
return ret ;
2852
2859
}
2853
2860
0 commit comments