drm/vc4: hdmi: Use local vc4_hdmi directly
authorMaxime Ripard <maxime@cerno.tech>
Mon, 6 Jan 2020 17:44:36 +0000 (18:44 +0100)
committerpopcornmix <popcornmix@gmail.com>
Wed, 1 Jul 2020 15:33:39 +0000 (16:33 +0100)
The function vc4_hdmi_connector_detect access its vc4_hdmi struct by
dereferencing the pointer in the structure vc4_dev. This will cause some
issues when we will have multiple HDMI controllers, so let's just use the
local variable for now instead of dereferencing that pointer all the time,
and we'll fix the local variable later.

Signed-off-by: Maxime Ripard <maxime@cerno.tech>
drivers/gpu/drm/vc4/vc4_hdmi.c

index 00f3624..a208058 100644 (file)
@@ -124,20 +124,20 @@ vc4_hdmi_connector_detect(struct drm_connector *connector, bool force)
        struct vc4_dev *vc4 = to_vc4_dev(dev);
        struct vc4_hdmi *vc4_hdmi = vc4->hdmi;
 
-       if (vc4->hdmi->hpd_gpio) {
-               if (gpio_get_value_cansleep(vc4->hdmi->hpd_gpio) ^
-                   vc4->hdmi->hpd_active_low)
+       if (vc4_hdmi->hpd_gpio) {
+               if (gpio_get_value_cansleep(vc4_hdmi->hpd_gpio) ^
+                   vc4_hdmi->hpd_active_low)
                        return connector_status_connected;
-               cec_phys_addr_invalidate(vc4->hdmi->cec_adap);
+               cec_phys_addr_invalidate(vc4_hdmi->cec_adap);
                return connector_status_disconnected;
        }
 
-       if (drm_probe_ddc(vc4->hdmi->ddc))
+       if (drm_probe_ddc(vc4_hdmi->ddc))
                return connector_status_connected;
 
        if (HDMI_READ(VC4_HDMI_HOTPLUG) & VC4_HDMI_HOTPLUG_CONNECTED)
                return connector_status_connected;
-       cec_phys_addr_invalidate(vc4->hdmi->cec_adap);
+       cec_phys_addr_invalidate(vc4_hdmi->cec_adap);
        return connector_status_disconnected;
 }