drm/vc4: hdmi: Remove vc4_dev hdmi pointer
authorMaxime Ripard <maxime@cerno.tech>
Mon, 6 Jan 2020 17:49:11 +0000 (18:49 +0100)
committerpopcornmix <popcornmix@gmail.com>
Wed, 1 Jul 2020 15:33:39 +0000 (16:33 +0100)
Now that we don't have any users anymore, we can kill that pointer.

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

index 4a83b88..48d96ae 100644 (file)
@@ -76,7 +76,6 @@ struct vc4_dev {
        bool firmware_kms;
        struct rpi_firmware *firmware;
 
-       struct vc4_hdmi *hdmi;
        struct vc4_hvs *hvs;
        struct vc4_v3d *v3d;
        struct vc4_dpi *dpi;
index eb8a43c..251567a 100644 (file)
@@ -1199,7 +1199,6 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data)
 #endif
        struct platform_device *pdev = to_platform_device(dev);
        struct drm_device *drm = dev_get_drvdata(master);
-       struct vc4_dev *vc4 = drm->dev_private;
        struct vc4_hdmi *vc4_hdmi;
        struct drm_encoder *encoder;
        struct device_node *ddc_node;
@@ -1287,8 +1286,6 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data)
                vc4_hdmi->hpd_active_low = hpd_gpio_flags & OF_GPIO_ACTIVE_LOW;
        }
 
-       vc4->hdmi = vc4_hdmi;
-
        /* HDMI core must be enabled. */
        if (!(HD_READ(VC4_HD_M_CTL) & VC4_HD_M_ENABLE)) {
                HD_WRITE(VC4_HD_M_CTL, VC4_HD_M_SW_RST);
@@ -1369,9 +1366,12 @@ err_put_i2c:
 static void vc4_hdmi_unbind(struct device *dev, struct device *master,
                            void *data)
 {
-       struct drm_device *drm = dev_get_drvdata(master);
-       struct vc4_dev *vc4 = drm->dev_private;
-       struct vc4_hdmi *vc4_hdmi = vc4->hdmi;
+       /*
+        * snd_soc_register_card will set the device drvdata pointer
+        * to the card being registered.
+        */
+       struct snd_soc_card *card = dev_get_drvdata(dev);
+       struct vc4_hdmi *vc4_hdmi = snd_soc_card_get_drvdata(card);
 
        cec_unregister_adapter(vc4_hdmi->cec_adap);
        vc4_hdmi_connector_destroy(&vc4_hdmi->connector.base);
@@ -1381,8 +1381,6 @@ static void vc4_hdmi_unbind(struct device *dev, struct device *master,
        pm_runtime_disable(dev);
 
        put_device(&vc4_hdmi->ddc->dev);
-
-       vc4->hdmi = NULL;
 }
 
 static const struct component_ops vc4_hdmi_ops = {