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)
679
679
struct msm_gpu * gpu = dev_to_gpu (dev );
680
680
int remaining , ret ;
681
681
682
+ if (!gpu )
683
+ return 0 ;
684
+
682
685
suspend_scheduler (gpu );
683
686
684
687
remaining = wait_event_timeout (gpu -> retire_event ,
@@ -700,7 +703,12 @@ static int adreno_system_suspend(struct device *dev)
700
703
701
704
static int adreno_system_resume (struct device * dev )
702
705
{
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 );
704
712
return pm_runtime_force_resume (dev );
705
713
}
706
714
Original file line number Diff line number Diff line change @@ -997,4 +997,6 @@ void msm_gpu_cleanup(struct msm_gpu *gpu)
997
997
}
998
998
999
999
msm_devfreq_cleanup (gpu );
1000
+
1001
+ platform_set_drvdata (gpu -> pdev , NULL );
1000
1002
}
Original file line number Diff line number Diff line change @@ -280,6 +280,10 @@ struct msm_gpu {
280
280
static inline struct msm_gpu * dev_to_gpu (struct device * dev )
281
281
{
282
282
struct adreno_smmu_priv * adreno_smmu = dev_get_drvdata (dev );
283
+
284
+ if (!adreno_smmu )
285
+ return NULL ;
286
+
283
287
return container_of (adreno_smmu , struct msm_gpu , adreno_smmu );
284
288
}
285
289
You can’t perform that action at this time.
0 commit comments