File tree Expand file tree Collapse file tree 3 files changed +13
-10
lines changed Expand file tree Collapse file tree 3 files changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -380,7 +380,7 @@ static int init_cc_resources(struct platform_device *plat_dev)
380
380
rc = cc_ivgen_init (new_drvdata );
381
381
if (rc ) {
382
382
dev_err (dev , "cc_ivgen_init failed\n" );
383
- goto post_power_mgr_err ;
383
+ goto post_buf_mgr_err ;
384
384
}
385
385
386
386
/* Allocate crypto algs */
@@ -403,6 +403,9 @@ static int init_cc_resources(struct platform_device *plat_dev)
403
403
goto post_hash_err ;
404
404
}
405
405
406
+ /* All set, we can allow autosuspend */
407
+ cc_pm_go (new_drvdata );
408
+
406
409
/* If we got here and FIPS mode is enabled
407
410
* it means all FIPS test passed, so let TEE
408
411
* know we're good.
@@ -417,8 +420,6 @@ static int init_cc_resources(struct platform_device *plat_dev)
417
420
cc_cipher_free (new_drvdata );
418
421
post_ivgen_err :
419
422
cc_ivgen_fini (new_drvdata );
420
- post_power_mgr_err :
421
- cc_pm_fini (new_drvdata );
422
423
post_buf_mgr_err :
423
424
cc_buffer_mgr_fini (new_drvdata );
424
425
post_req_mgr_err :
Original file line number Diff line number Diff line change @@ -100,20 +100,19 @@ int cc_pm_put_suspend(struct device *dev)
100
100
101
101
int cc_pm_init (struct cc_drvdata * drvdata )
102
102
{
103
- int rc = 0 ;
104
103
struct device * dev = drvdata_to_dev (drvdata );
105
104
106
105
/* must be before the enabling to avoid resdundent suspending */
107
106
pm_runtime_set_autosuspend_delay (dev , CC_SUSPEND_TIMEOUT );
108
107
pm_runtime_use_autosuspend (dev );
109
108
/* activate the PM module */
110
- rc = pm_runtime_set_active (dev );
111
- if (rc )
112
- return rc ;
113
- /* enable the PM module*/
114
- pm_runtime_enable (dev );
109
+ return pm_runtime_set_active (dev );
110
+ }
115
111
116
- return rc ;
112
+ /* enable the PM module*/
113
+ void cc_pm_go (struct cc_drvdata * drvdata )
114
+ {
115
+ pm_runtime_enable (drvdata_to_dev (drvdata ));
117
116
}
118
117
119
118
void cc_pm_fini (struct cc_drvdata * drvdata )
Original file line number Diff line number Diff line change 16
16
extern const struct dev_pm_ops ccree_pm ;
17
17
18
18
int cc_pm_init (struct cc_drvdata * drvdata );
19
+ void cc_pm_go (struct cc_drvdata * drvdata );
19
20
void cc_pm_fini (struct cc_drvdata * drvdata );
20
21
int cc_pm_suspend (struct device * dev );
21
22
int cc_pm_resume (struct device * dev );
@@ -29,6 +30,8 @@ static inline int cc_pm_init(struct cc_drvdata *drvdata)
29
30
return 0 ;
30
31
}
31
32
33
+ static void cc_pm_go (struct cc_drvdata * drvdata ) {}
34
+
32
35
static inline void cc_pm_fini (struct cc_drvdata * drvdata ) {}
33
36
34
37
static inline int cc_pm_suspend (struct device * dev )
You can’t perform that action at this time.
0 commit comments