diff options
author | Marek Szyprowski <m.szyprowski@samsung.com> | 2016-11-16 12:04:55 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-11-30 14:20:00 +0300 |
commit | 387e08e2021022e764a235df6c1f0ed3d861f711 (patch) | |
tree | 3fab8d8b8b2b82dfa85d9135b80b861019c20367 /drivers/media | |
parent | 7e55a016fac080118a634179405c821c31d8bd2e (diff) | |
download | linux-387e08e2021022e764a235df6c1f0ed3d861f711.tar.xz |
[media] s5p-mfc: Kill all IS_ERR_OR_NULL in clocks management code
After commit "s5p-mfc: Fix clock management in s5p_mfc_release function"
all clocks related functions are called only when MFC device is really
available, so there is no additional check needed for NULL
gate clocks. This patch simplifies the code and kills IS_ERR_OR_NULL
macro usage.
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/platform/s5p-mfc/s5p_mfc_pm.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_pm.c b/drivers/media/platform/s5p-mfc/s5p_mfc_pm.c index 11a918eb7564..b514584cf00d 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_pm.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_pm.c @@ -91,16 +91,12 @@ void s5p_mfc_final_pm(struct s5p_mfc_dev *dev) int s5p_mfc_clock_on(void) { - int ret = 0; - atomic_inc(&clk_ref); mfc_debug(3, "+ %d\n", atomic_read(&clk_ref)); if (!pm->use_clock_gating) return 0; - if (!IS_ERR_OR_NULL(pm->clock_gate)) - ret = clk_enable(pm->clock_gate); - return ret; + return clk_enable(pm->clock_gate); } void s5p_mfc_clock_off(void) @@ -110,8 +106,7 @@ void s5p_mfc_clock_off(void) if (!pm->use_clock_gating) return; - if (!IS_ERR_OR_NULL(pm->clock_gate)) - clk_disable(pm->clock_gate); + clk_disable(pm->clock_gate); } int s5p_mfc_power_on(void) @@ -122,14 +117,14 @@ int s5p_mfc_power_on(void) if (ret) return ret; - if (!pm->use_clock_gating && !IS_ERR_OR_NULL(pm->clock_gate)) + if (!pm->use_clock_gating) ret = clk_enable(pm->clock_gate); return ret; } int s5p_mfc_power_off(void) { - if (!pm->use_clock_gating && !IS_ERR_OR_NULL(pm->clock_gate)) + if (!pm->use_clock_gating) clk_disable(pm->clock_gate); return pm_runtime_put_sync(pm->device); } |