media: sun8i: Fix an error handling path in 'deinterlace_runtime_resume()'
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Tue, 5 May 2020 07:50:34 +0000 (09:50 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Tue, 5 May 2020 15:26:26 +0000 (17:26 +0200)
It is spurious to call 'clk_disable_unprepare()' when
'clk_prepare_enable()' has not been called yet.
Re-order the error handling path to avoid it.

Fixes: a4260ea49547 ("media: sun4i: Add H3 deinterlace driver")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
[hverkuil-cisco@xs4all.nl: err_exlusive_rate -> err_exclusive_rate]
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/platform/sunxi/sun8i-di/sun8i-di.c

index d78f6593ddd1bb577eeefceaaff0b35db7f4d7d2..ba5d07886607220bb07a82ccecb1b6d1fb9adaaa 100644 (file)
@@ -941,7 +941,7 @@ static int deinterlace_runtime_resume(struct device *device)
        if (ret) {
                dev_err(dev->dev, "Failed to enable bus clock\n");
 
-               goto err_exlusive_rate;
+               goto err_exclusive_rate;
        }
 
        ret = clk_prepare_enable(dev->mod_clk);
@@ -969,14 +969,14 @@ static int deinterlace_runtime_resume(struct device *device)
 
        return 0;
 
-err_exlusive_rate:
-       clk_rate_exclusive_put(dev->mod_clk);
 err_ram_clk:
        clk_disable_unprepare(dev->ram_clk);
 err_mod_clk:
        clk_disable_unprepare(dev->mod_clk);
 err_bus_clk:
        clk_disable_unprepare(dev->bus_clk);
+err_exclusive_rate:
+       clk_rate_exclusive_put(dev->mod_clk);
 
        return ret;
 }