vdec: initialize work before interrupt comming [1/1]
authorapollo.ling <apollo.ling@amlogic.com>
Thu, 18 Jun 2020 12:15:22 +0000 (20:15 +0800)
committerApollo Ling <apollo.ling@amlogic.com>
Tue, 23 Jun 2020 07:02:16 +0000 (00:02 -0700)
PD#SWPL-27087

Problem:
The work is executed before it is initialized.

Solution:
initialize work before interrupt comming

Verify:
AC214

Change-Id: Ida18f12e390e518421b498f6373a3e30766d91f4
Signed-off-by: apollo.ling <apollo.ling@amlogic.com>
drivers/frame_provider/decoder/avs/avs.c
drivers/frame_provider/decoder/real/vreal.c

index 323f3225b3891b61fb3061d2de6262394a647adb..3dfc79924697c568822c8524e946a7c3d85341b3 100644 (file)
@@ -1716,21 +1716,20 @@ static int amvdec_avs_probe(struct platform_device *pdev)
 
        INIT_WORK(&set_clk_work, avs_set_clk);
        vdec = pdata;
-       if (vavs_init() < 0) {
-               pr_info("amvdec_avs init failed.\n");
-               kfree(gvs);
-               gvs = NULL;
-               pdata->dec_status = NULL;
-               return -ENODEV;
-       }
 
        INIT_WORK(&fatal_error_wd_work, vavs_fatal_error_handler);
        atomic_set(&error_handler_run, 0);
 
        INIT_WORK(&userdata_push_work, userdata_push_do_work);
-
        INIT_WORK(&notify_work, vavs_notify_work);
 
+       if (vavs_init() < 0) {
+               pr_info("amvdec_avs init failed.\n");
+               kfree(gvs);
+               gvs = NULL;
+               pdata->dec_status = NULL;
+               return -ENODEV;
+       }
        return 0;
 }
 
index 49bd408bbb06881edb5157c9ee465679b094d6a1..f6474b676c7ad07079302e988ebf50db3389422b 100644 (file)
@@ -945,12 +945,12 @@ static int amvdec_real_probe(struct platform_device *pdev)
        pdata->set_isreset = vreal_set_isreset;
        is_reset = 0;
 
+       INIT_WORK(&set_clk_work, vreal_set_clk);
        if (vreal_init(pdata) < 0) {
                pr_info("amvdec_real init failed.\n");
                pdata->dec_status = NULL;
                return -ENODEV;
        }
-       INIT_WORK(&set_clk_work, vreal_set_clk);
        return 0;
 }