File tree Expand file tree Collapse file tree 4 files changed +7
-19
lines changed Expand file tree Collapse file tree 4 files changed +7
-19
lines changed Original file line number Diff line number Diff line change @@ -332,11 +332,6 @@ static int caam_remove(struct platform_device *pdev)
332332 /* Remove platform devices under the crypto node */
333333 of_platform_depopulate (ctrldev );
334334
335- #ifdef CONFIG_CAAM_QI
336- if (ctrlpriv -> qi_init )
337- caam_qi_shutdown (ctrldev );
338- #endif
339-
340335 return 0 ;
341336}
342337
@@ -769,7 +764,7 @@ static int caam_probe(struct platform_device *pdev)
769764 ret = of_platform_populate (nprop , caam_match , NULL , dev );
770765 if (ret ) {
771766 dev_err (dev , "JR platform devices creation error\n" );
772- goto shutdown_qi ;
767+ return ret ;
773768 }
774769
775770 ring = 0 ;
@@ -930,13 +925,6 @@ static int caam_probe(struct platform_device *pdev)
930925caam_remove :
931926 caam_remove (pdev );
932927 return ret ;
933-
934- shutdown_qi :
935- #ifdef CONFIG_CAAM_QI
936- if (ctrlpriv -> qi_init )
937- caam_qi_shutdown (dev );
938- #endif
939- return ret ;
940928}
941929
942930static struct platform_driver caam_driver = {
Original file line number Diff line number Diff line change @@ -81,9 +81,6 @@ struct caam_drv_private {
8181 */
8282 u8 total_jobrs ; /* Total Job Rings in device */
8383 u8 qi_present ; /* Nonzero if QI present in device */
84- #ifdef CONFIG_CAAM_QI
85- u8 qi_init ; /* Nonzero if QI has been initialized */
86- #endif
8784 u8 mc_en ; /* Nonzero if MC f/w is active */
8885 int secvio_irq ; /* Security violation interrupt number */
8986 int virt_en ; /* Virtualization enabled in CAAM */
Original file line number Diff line number Diff line change @@ -500,9 +500,10 @@ void caam_drv_ctx_rel(struct caam_drv_ctx *drv_ctx)
500500}
501501EXPORT_SYMBOL (caam_drv_ctx_rel );
502502
503- void caam_qi_shutdown (struct device * qidev )
503+ static void caam_qi_shutdown (void * data )
504504{
505505 int i ;
506+ struct device * qidev = data ;
506507 struct caam_qi_priv * priv = & qipriv ;
507508 const cpumask_t * cpus = qman_affine_cpus ();
508509
@@ -761,7 +762,10 @@ int caam_qi_init(struct platform_device *caam_pdev)
761762 & times_congested , & caam_fops_u64_ro );
762763#endif
763764
764- ctrlpriv -> qi_init = 1 ;
765+ err = devm_add_action_or_reset (qidev , caam_qi_shutdown , ctrlpriv );
766+ if (err )
767+ return err ;
768+
765769 dev_info (qidev , "Linux CAAM Queue I/F driver initialised\n" );
766770 return 0 ;
767771}
Original file line number Diff line number Diff line change @@ -147,7 +147,6 @@ int caam_drv_ctx_update(struct caam_drv_ctx *drv_ctx, u32 *sh_desc);
147147void caam_drv_ctx_rel (struct caam_drv_ctx * drv_ctx );
148148
149149int caam_qi_init (struct platform_device * pdev );
150- void caam_qi_shutdown (struct device * dev );
151150
152151/**
153152 * qi_cache_alloc - Allocate buffers from CAAM-QI cache
You can’t perform that action at this time.
0 commit comments