From: Jeongtae Park Date: Thu, 26 Apr 2018 02:50:37 +0000 (+0900) Subject: [COMMON] fimc-is2: simplify getting .drvdata X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9212c1bb24eb9346082c1f9cc88663352dc9cd43;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [COMMON] fimc-is2: simplify getting .drvdata We should get drvdata from struct device directly. Going via platform_device is an unneeded step back and forth. Change-Id: I76cd504d46b1f19a71d14b7a729652166f7f5c6d Signed-off-by: Jeongtae Park --- diff --git a/drivers/media/platform/exynos/fimc-is2/fimc-is-core.c b/drivers/media/platform/exynos/fimc-is2/fimc-is-core.c index 8d6d58976edf..d49590bdebea 100644 --- a/drivers/media/platform/exynos/fimc-is2/fimc-is-core.c +++ b/drivers/media/platform/exynos/fimc-is2/fimc-is-core.c @@ -558,7 +558,7 @@ static ssize_t store_en_dvfs(struct device *dev, { #ifdef ENABLE_DVFS struct fimc_is_core *core = - (struct fimc_is_core *)platform_get_drvdata(to_platform_device(dev)); + (struct fimc_is_core *)dev_get_drvdata(dev); struct fimc_is_resourcemgr *resourcemgr; int i; @@ -698,7 +698,7 @@ static ssize_t show_debug_state(struct device *dev, struct device_attribute *att char *buf) { struct fimc_is_core *core = - (struct fimc_is_core *)platform_get_drvdata(to_platform_device(dev)); + (struct fimc_is_core *)dev_get_drvdata(dev); struct fimc_is_resourcemgr *resourcemgr; FIMC_BUG(!core); @@ -713,7 +713,7 @@ static ssize_t store_debug_state(struct device *dev, const char *buf, size_t count) { struct fimc_is_core *core = - (struct fimc_is_core *)platform_get_drvdata(to_platform_device(dev)); + (struct fimc_is_core *)dev_get_drvdata(dev); struct fimc_is_resourcemgr *resourcemgr; FIMC_BUG(!core); diff --git a/drivers/media/platform/exynos/fimc-is2/fimc-is-device-ischain.c b/drivers/media/platform/exynos/fimc-is2/fimc-is-device-ischain.c index 2dbfa0aeb35a..7d0207e87088 100644 --- a/drivers/media/platform/exynos/fimc-is2/fimc-is-device-ischain.c +++ b/drivers/media/platform/exynos/fimc-is2/fimc-is-device-ischain.c @@ -2192,7 +2192,7 @@ int fimc_is_ischain_runtime_suspend(struct device *dev) { int ret = 0; struct platform_device *pdev = to_platform_device(dev); - struct fimc_is_core *core = (struct fimc_is_core *)platform_get_drvdata(pdev); + struct fimc_is_core *core = (struct fimc_is_core *)dev_get_drvdata(dev); struct fimc_is_mem *mem = &core->resourcemgr.mem; struct exynos_platform_fimc_is *pdata; @@ -2275,7 +2275,7 @@ int fimc_is_ischain_runtime_resume(struct device *dev) { int ret = 0; struct platform_device *pdev = to_platform_device(dev); - struct fimc_is_core *core = (struct fimc_is_core *)platform_get_drvdata(pdev); + struct fimc_is_core *core = (struct fimc_is_core *)dev_get_drvdata(dev); struct fimc_is_mem *mem = &core->resourcemgr.mem; struct exynos_platform_fimc_is *pdata; @@ -2393,7 +2393,7 @@ int fimc_is_ischain_power(struct fimc_is_device_ischain *device, int on) FIMC_BUG(!device->interface); dev = &device->pdev->dev; - core = (struct fimc_is_core *)platform_get_drvdata(device->pdev); + core = (struct fimc_is_core *)dev_get_drvdata(dev); vender = &core->vender; itf = device->interface; @@ -2541,7 +2541,7 @@ int fimc_is_ischain_power(struct fimc_is_device_ischain *device, int on) FIMC_BUG(!device->interface); dev = &device->pdev->dev; - core = (struct fimc_is_core *)platform_get_drvdata(device->pdev); + core = (struct fimc_is_core *)dev_get_drvdata(dev); vender = &core->vender; if (on) { diff --git a/drivers/media/platform/exynos/fimc-is2/fimc-is-device-preprocessor.c b/drivers/media/platform/exynos/fimc-is2/fimc-is-device-preprocessor.c index b4ff2e5c4f9b..903d32965158 100644 --- a/drivers/media/platform/exynos/fimc-is2/fimc-is-device-preprocessor.c +++ b/drivers/media/platform/exynos/fimc-is2/fimc-is-device-preprocessor.c @@ -689,10 +689,9 @@ static int fimc_is_preproc_resume(struct device *dev) int fimc_is_preproc_runtime_suspend(struct device *dev) { int ret = 0; - struct platform_device *pdev = to_platform_device(dev); struct fimc_is_device_preproc *device; - device = (struct fimc_is_device_preproc *)platform_get_drvdata(pdev); + device = (struct fimc_is_device_preproc *)dev_get_drvdata(dev); if (!device) { err("device is NULL"); ret = -EINVAL; @@ -734,10 +733,9 @@ p_err: int fimc_is_preproc_runtime_resume(struct device *dev) { int ret = 0; - struct platform_device *pdev = to_platform_device(dev); struct fimc_is_device_preproc *device; - device = (struct fimc_is_device_preproc *)platform_get_drvdata(pdev); + device = (struct fimc_is_device_preproc *)dev_get_drvdata(dev); if (!device) { err("device is NULL"); ret = -EINVAL; diff --git a/drivers/media/platform/exynos/fimc-is2/ischain/fimc-is-v3_11_0/fimc-is-hw-pwr.c b/drivers/media/platform/exynos/fimc-is2/ischain/fimc-is-v3_11_0/fimc-is-hw-pwr.c index 114f52e9f637..09b23887c3c8 100644 --- a/drivers/media/platform/exynos/fimc-is2/ischain/fimc-is-v3_11_0/fimc-is-hw-pwr.c +++ b/drivers/media/platform/exynos/fimc-is2/ischain/fimc-is-v3_11_0/fimc-is-hw-pwr.c @@ -29,10 +29,9 @@ int fimc_is_sensor_runtime_suspend_pre(struct device *dev) { int ret = 0; - struct platform_device *pdev = to_platform_device(dev); struct fimc_is_device_sensor *device; - device = (struct fimc_is_device_sensor *)platform_get_drvdata(pdev); + device = (struct fimc_is_device_sensor *)dev_get_drvdata(dev); if (!device) { err("device is NULL"); goto p_err; @@ -45,10 +44,9 @@ p_err: int fimc_is_sensor_runtime_resume_pre(struct device *dev) { int ret = 0; - struct platform_device *pdev = to_platform_device(dev); struct fimc_is_device_sensor *device; - device = (struct fimc_is_device_sensor *)platform_get_drvdata(pdev); + device = (struct fimc_is_device_sensor *)dev_get_drvdata(dev); if (!device) { err("device is NULL"); goto p_err; @@ -63,7 +61,6 @@ int fimc_is_ischain_runtime_suspend_post(struct device *dev) int ret = 0; #ifndef CONFIG_PM { - struct platform_device *pdev = to_platform_device(dev); struct fimc_is_device_ischain *device; void __iomem *reg_mux_clkphy; void __iomem *reg_isp_idleness_ch0; @@ -72,7 +69,7 @@ int fimc_is_ischain_runtime_suspend_post(struct device *dev) u32 try_count; unsigned int state; - device = (struct fimc_is_device_ischain *)platform_get_drvdata(pdev); + device = (struct fimc_is_device_ishcain *)dev_get_drvdata(dev); if (!device) { err("device is NULL"); goto p_err; diff --git a/drivers/media/platform/exynos/fimc-is2/ischain/fimc-is-v4_0_0/fimc-is-hw-pwr.c b/drivers/media/platform/exynos/fimc-is2/ischain/fimc-is-v4_0_0/fimc-is-hw-pwr.c index 6c68705e4710..5988c856fe46 100644 --- a/drivers/media/platform/exynos/fimc-is2/ischain/fimc-is-v4_0_0/fimc-is-hw-pwr.c +++ b/drivers/media/platform/exynos/fimc-is2/ischain/fimc-is-v4_0_0/fimc-is-hw-pwr.c @@ -29,10 +29,9 @@ int fimc_is_sensor_runtime_suspend_pre(struct device *dev) { int ret = 0; - struct platform_device *pdev = to_platform_device(dev); struct fimc_is_device_sensor *device; - device = (struct fimc_is_device_sensor *)platform_get_drvdata(pdev); + device = (struct fimc_is_device_sensor *)dev_get_drvdata(dev); if (!device) { err("device is NULL"); goto p_err; @@ -59,10 +58,9 @@ p_err: int fimc_is_sensor_runtime_resume_pre(struct device *dev) { int ret = 0; - struct platform_device *pdev = to_platform_device(dev); struct fimc_is_device_sensor *device; - device = (struct fimc_is_device_sensor *)platform_get_drvdata(pdev); + device = (struct fimc_is_device_sensor *)dev_get_drvdata(dev); if (!device) { err("device is NULL"); goto p_err; @@ -647,4 +645,4 @@ int fimc_is_runtime_suspend_post(struct device *dev) p_err: return ret; -} \ No newline at end of file +} diff --git a/drivers/media/platform/exynos/fimc-is2/ischain/fimc-is-v4_3_0/fimc-is-hw-pwr.c b/drivers/media/platform/exynos/fimc-is2/ischain/fimc-is-v4_3_0/fimc-is-hw-pwr.c index 812c2b681c43..65f57f0a3f25 100644 --- a/drivers/media/platform/exynos/fimc-is2/ischain/fimc-is-v4_3_0/fimc-is-hw-pwr.c +++ b/drivers/media/platform/exynos/fimc-is2/ischain/fimc-is-v4_3_0/fimc-is-hw-pwr.c @@ -33,11 +33,10 @@ int fimc_is_sensor_runtime_suspend_pre(struct device *dev) { int ret = 0; - struct platform_device *pdev = to_platform_device(dev); struct fimc_is_device_sensor *device; unsigned int state; - device = (struct fimc_is_device_sensor *)platform_get_drvdata(pdev); + device = (struct fimc_is_device_sensor *)dev_get_drvdata(dev); if (!device) { err("device is NULL"); goto p_err; @@ -70,10 +69,9 @@ p_err: int fimc_is_sensor_runtime_resume_pre(struct device *dev) { int ret = 0; - struct platform_device *pdev = to_platform_device(dev); struct fimc_is_device_sensor *device; - device = (struct fimc_is_device_sensor *)platform_get_drvdata(pdev); + device = (struct fimc_is_device_sensor *)dev_get_drvdata(dev); if (!device) { err("device is NULL"); goto p_err; diff --git a/drivers/media/platform/exynos/fimc-is2/ischain/fimc-is-v5_10_0/fimc-is-hw-pwr.c b/drivers/media/platform/exynos/fimc-is2/ischain/fimc-is-v5_10_0/fimc-is-hw-pwr.c index c2479263911b..99da446f2b87 100644 --- a/drivers/media/platform/exynos/fimc-is2/ischain/fimc-is-v5_10_0/fimc-is-hw-pwr.c +++ b/drivers/media/platform/exynos/fimc-is2/ischain/fimc-is-v5_10_0/fimc-is-hw-pwr.c @@ -27,10 +27,9 @@ int fimc_is_sensor_runtime_suspend_pre(struct device *dev) { int ret = 0; - struct platform_device *pdev = to_platform_device(dev); struct fimc_is_device_sensor *device; - device = (struct fimc_is_device_sensor *)platform_get_drvdata(pdev); + device = (struct fimc_is_device_sensor *)dev_get_drvdata(dev); if (!device) { err("device is NULL"); goto p_err; @@ -43,10 +42,9 @@ p_err: int fimc_is_sensor_runtime_resume_pre(struct device *dev) { int ret = 0; - struct platform_device *pdev = to_platform_device(dev); struct fimc_is_device_sensor *device; - device = (struct fimc_is_device_sensor *)platform_get_drvdata(pdev); + device = (struct fimc_is_device_sensor *)dev_get_drvdata(dev); if (!device) { err("device is NULL"); goto p_err;