diff options
author | Andrzej Hajda <a.hajda@samsung.com> | 2014-11-13 16:37:57 +0900 |
---|---|---|
committer | Inki Dae <inki.dae@samsung.com> | 2014-11-24 18:02:49 +0900 |
commit | 7239067795dc03be5b152034558bed0bb9c73ab3 (patch) | |
tree | 57b0bf3baf78eb5c782a24d00a6a94849f048a92 /drivers/gpu/drm/exynos/exynos_drm_drv.h | |
parent | 421ee18d4e040d673f5ce2972efa75c2ce0826d9 (diff) | |
download | lwn-7239067795dc03be5b152034558bed0bb9c73ab3.tar.gz lwn-7239067795dc03be5b152034558bed0bb9c73ab3.zip |
drm/exynos: remove ifdeferry from initialization code
The patch replaces separate calls to driver (de)registration by
loops over the array of drivers. As a result it significantly
decreases number of ifdefs. Additionally it moves device registration
related ifdefs to header file.
Changelog v2:
- Rebased.
- Consider non kms driver in respect to infinite loop issue.
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Diffstat (limited to 'drivers/gpu/drm/exynos/exynos_drm_drv.h')
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_drv.h | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h index d22e640f59a0..3c81c4b60399 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h @@ -323,15 +323,14 @@ int exynos_platform_device_hdmi_register(void); */ void exynos_platform_device_hdmi_unregister(void); -/* - * this function registers exynos drm ipp platform device. - */ +#ifdef CONFIG_DRM_EXYNOS_IPP int exynos_platform_device_ipp_register(void); - -/* - * this function unregisters exynos drm ipp platform device if it exists. - */ void exynos_platform_device_ipp_unregister(void); +#else +static inline int exynos_platform_device_ipp_register(void) { return 0; } +static inline void exynos_platform_device_ipp_unregister(void) {} +#endif + #ifdef CONFIG_DRM_EXYNOS_DPI struct exynos_drm_display * exynos_dpi_probe(struct device *dev); @@ -342,15 +341,13 @@ exynos_dpi_probe(struct device *dev) { return NULL; } static inline int exynos_dpi_remove(struct device *dev) { return 0; } #endif -/* - * this function registers exynos drm vidi platform device/driver. - */ +#ifdef CONFIG_DRM_EXYNOS_VIDI int exynos_drm_probe_vidi(void); - -/* - * this function unregister exynos drm vidi platform device/driver. - */ void exynos_drm_remove_vidi(void); +#else +static inline int exynos_drm_probe_vidi(void) { return 0; } +static inline void exynos_drm_remove_vidi(void) {} +#endif /* This function creates a encoder and a connector, and initializes them. */ int exynos_drm_create_enc_conn(struct drm_device *dev, |