File tree Expand file tree Collapse file tree 7 files changed +25
-14
lines changed
drivers/gpu/drm/amd/amdgpu Expand file tree Collapse file tree 7 files changed +25
-14
lines changed Original file line number Diff line number Diff line change @@ -1778,9 +1778,11 @@ int amdgpu_gfx_sysfs_init(struct amdgpu_device *adev)
17781778
17791779void amdgpu_gfx_sysfs_fini (struct amdgpu_device * adev )
17801780{
1781- amdgpu_gfx_sysfs_xcp_fini (adev );
1782- amdgpu_gfx_sysfs_isolation_shader_fini (adev );
1783- amdgpu_gfx_sysfs_reset_mask_fini (adev );
1781+ if (adev -> dev -> kobj .sd ) {
1782+ amdgpu_gfx_sysfs_xcp_fini (adev );
1783+ amdgpu_gfx_sysfs_isolation_shader_fini (adev );
1784+ amdgpu_gfx_sysfs_reset_mask_fini (adev );
1785+ }
17841786}
17851787
17861788int amdgpu_gfx_cleaner_shader_sw_init (struct amdgpu_device * adev ,
Original file line number Diff line number Diff line change @@ -447,6 +447,8 @@ int amdgpu_jpeg_sysfs_reset_mask_init(struct amdgpu_device *adev)
447447
448448void amdgpu_jpeg_sysfs_reset_mask_fini (struct amdgpu_device * adev )
449449{
450- if (adev -> jpeg .num_jpeg_inst )
451- device_remove_file (adev -> dev , & dev_attr_jpeg_reset_mask );
450+ if (adev -> dev -> kobj .sd ) {
451+ if (adev -> jpeg .num_jpeg_inst )
452+ device_remove_file (adev -> dev , & dev_attr_jpeg_reset_mask );
453+ }
452454}
Original file line number Diff line number Diff line change @@ -137,7 +137,8 @@ void amdgpu_preempt_mgr_fini(struct amdgpu_device *adev)
137137 if (ret )
138138 return ;
139139
140- device_remove_file (adev -> dev , & dev_attr_mem_info_preempt_used );
140+ if (adev -> dev -> kobj .sd )
141+ device_remove_file (adev -> dev , & dev_attr_mem_info_preempt_used );
141142
142143 ttm_resource_manager_cleanup (man );
143144 ttm_set_driver_manager (& adev -> mman .bdev , AMDGPU_PL_PREEMPT , NULL );
Original file line number Diff line number Diff line change @@ -451,6 +451,8 @@ void amdgpu_sdma_sysfs_reset_mask_fini(struct amdgpu_device *adev)
451451 if (!amdgpu_gpu_recovery )
452452 return ;
453453
454- if (adev -> sdma .num_instances )
455- device_remove_file (adev -> dev , & dev_attr_sdma_reset_mask );
454+ if (adev -> dev -> kobj .sd ) {
455+ if (adev -> sdma .num_instances )
456+ device_remove_file (adev -> dev , & dev_attr_sdma_reset_mask );
457+ }
456458}
Original file line number Diff line number Diff line change @@ -1315,6 +1315,8 @@ int amdgpu_vcn_sysfs_reset_mask_init(struct amdgpu_device *adev)
13151315
13161316void amdgpu_vcn_sysfs_reset_mask_fini (struct amdgpu_device * adev )
13171317{
1318- if (adev -> vcn .num_vcn_inst )
1319- device_remove_file (adev -> dev , & dev_attr_vcn_reset_mask );
1318+ if (adev -> dev -> kobj .sd ) {
1319+ if (adev -> vcn .num_vcn_inst )
1320+ device_remove_file (adev -> dev , & dev_attr_vcn_reset_mask );
1321+ }
13201322}
Original file line number Diff line number Diff line change @@ -904,8 +904,10 @@ int amdgpu_vpe_sysfs_reset_mask_init(struct amdgpu_device *adev)
904904
905905void amdgpu_vpe_sysfs_reset_mask_fini (struct amdgpu_device * adev )
906906{
907- if (adev -> vpe .num_instances )
908- device_remove_file (adev -> dev , & dev_attr_vpe_reset_mask );
907+ if (adev -> dev -> kobj .sd ) {
908+ if (adev -> vpe .num_instances )
909+ device_remove_file (adev -> dev , & dev_attr_vpe_reset_mask );
910+ }
909911}
910912
911913static const struct amdgpu_ring_funcs vpe_ring_funcs = {
Original file line number Diff line number Diff line change @@ -254,8 +254,8 @@ static void df_v3_6_sw_init(struct amdgpu_device *adev)
254254
255255static void df_v3_6_sw_fini (struct amdgpu_device * adev )
256256{
257-
258- device_remove_file (adev -> dev , & dev_attr_df_cntr_avail );
257+ if ( adev -> dev -> kobj . sd )
258+ device_remove_file (adev -> dev , & dev_attr_df_cntr_avail );
259259
260260}
261261
You can’t perform that action at this time.
0 commit comments