diff options
author | Andrzej Hajda <a.hajda@samsung.com> | 2015-09-25 15:48:26 +0300 |
---|---|---|
committer | Inki Dae <daeinki@gmail.com> | 2015-10-26 09:10:01 +0300 |
commit | 185f22d222fb12d571eed43fc6d5d13e27813f05 (patch) | |
tree | ef4d43ffcb3397d76d9430d656cd91dc552fce8f /drivers/gpu/drm/exynos/exynos_hdmi.c | |
parent | af1f7c24d619f2c21f7f6cbac140ef469840e6d3 (diff) | |
download | linux-185f22d222fb12d571eed43fc6d5d13e27813f05.tar.xz |
drm/exynos/hdmi: convert container_of macro to inline function
Inline function is safer than macro, also the name has been changed to
be consistent with other inline function encoder_to_hdmi.
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Diffstat (limited to 'drivers/gpu/drm/exynos/exynos_hdmi.c')
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_hdmi.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c index 0d538d3cc38e..c5a0617c429d 100644 --- a/drivers/gpu/drm/exynos/exynos_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c @@ -46,8 +46,6 @@ #include "exynos_drm_crtc.h" #include "exynos_mixer.h" -#define ctx_from_connector(c) container_of(c, struct hdmi_context, connector) - #define HOTPLUG_DEBOUNCE_MS 1100 /* AVI header and aspect ratio */ @@ -128,6 +126,11 @@ static inline struct hdmi_context *encoder_to_hdmi(struct drm_encoder *e) return container_of(e, struct hdmi_context, encoder); } +static inline struct hdmi_context *connector_to_hdmi(struct drm_connector *c) +{ + return container_of(c, struct hdmi_context, connector); +} + struct hdmiphy_config { int pixel_clock; u8 conf[32]; @@ -935,7 +938,7 @@ static void hdmi_reg_infoframe(struct hdmi_context *hdata, static enum drm_connector_status hdmi_detect(struct drm_connector *connector, bool force) { - struct hdmi_context *hdata = ctx_from_connector(connector); + struct hdmi_context *hdata = connector_to_hdmi(connector); if (gpiod_get_value(hdata->hpd_gpio)) return connector_status_connected; @@ -961,7 +964,7 @@ static struct drm_connector_funcs hdmi_connector_funcs = { static int hdmi_get_modes(struct drm_connector *connector) { - struct hdmi_context *hdata = ctx_from_connector(connector); + struct hdmi_context *hdata = connector_to_hdmi(connector); struct edid *edid; int ret; @@ -1001,7 +1004,7 @@ static int hdmi_find_phy_conf(struct hdmi_context *hdata, u32 pixel_clock) static int hdmi_mode_valid(struct drm_connector *connector, struct drm_display_mode *mode) { - struct hdmi_context *hdata = ctx_from_connector(connector); + struct hdmi_context *hdata = connector_to_hdmi(connector); int ret; DRM_DEBUG_KMS("xres=%d, yres=%d, refresh=%d, intl=%d clock=%d\n", @@ -1022,7 +1025,7 @@ static int hdmi_mode_valid(struct drm_connector *connector, static struct drm_encoder *hdmi_best_encoder(struct drm_connector *connector) { - struct hdmi_context *hdata = ctx_from_connector(connector); + struct hdmi_context *hdata = connector_to_hdmi(connector); return &hdata->encoder; } |