File tree Expand file tree Collapse file tree 3 files changed +15
-1
lines changed Expand file tree Collapse file tree 3 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -679,6 +679,9 @@ static int adreno_system_suspend(struct device *dev)
679679 struct msm_gpu * gpu = dev_to_gpu (dev );
680680 int remaining , ret ;
681681
682+ if (!gpu )
683+ return 0 ;
684+
682685 suspend_scheduler (gpu );
683686
684687 remaining = wait_event_timeout (gpu -> retire_event ,
@@ -700,7 +703,12 @@ static int adreno_system_suspend(struct device *dev)
700703
701704static int adreno_system_resume (struct device * dev )
702705{
703- resume_scheduler (dev_to_gpu (dev ));
706+ struct msm_gpu * gpu = dev_to_gpu (dev );
707+
708+ if (!gpu )
709+ return 0 ;
710+
711+ resume_scheduler (gpu );
704712 return pm_runtime_force_resume (dev );
705713}
706714
Original file line number Diff line number Diff line change @@ -997,4 +997,6 @@ void msm_gpu_cleanup(struct msm_gpu *gpu)
997997 }
998998
999999 msm_devfreq_cleanup (gpu );
1000+
1001+ platform_set_drvdata (gpu -> pdev , NULL );
10001002}
Original file line number Diff line number Diff line change @@ -280,6 +280,10 @@ struct msm_gpu {
280280static inline struct msm_gpu * dev_to_gpu (struct device * dev )
281281{
282282 struct adreno_smmu_priv * adreno_smmu = dev_get_drvdata (dev );
283+
284+ if (!adreno_smmu )
285+ return NULL ;
286+
283287 return container_of (adreno_smmu , struct msm_gpu , adreno_smmu );
284288}
285289
You can’t perform that action at this time.
0 commit comments