kernel: bump 5.4 to 5.4.69
[openwrt/staging/mkresin.git] / target / linux / bcm27xx / patches-5.4 / 950-0578-drm-vc4-hdmi-Remove-vc4_dev-hdmi-pointer.patch
1 From 9e56da09cb8d8f65a26cfa0a957e295646ca47f8 Mon Sep 17 00:00:00 2001
2 From: Maxime Ripard <maxime@cerno.tech>
3 Date: Mon, 6 Jan 2020 18:49:11 +0100
4 Subject: [PATCH] drm/vc4: hdmi: Remove vc4_dev hdmi pointer
5
6 Now that we don't have any users anymore, we can kill that pointer.
7
8 Signed-off-by: Maxime Ripard <maxime@cerno.tech>
9 ---
10 drivers/gpu/drm/vc4/vc4_drv.h | 1 -
11 drivers/gpu/drm/vc4/vc4_hdmi.c | 14 ++++++--------
12 2 files changed, 6 insertions(+), 9 deletions(-)
13
14 --- a/drivers/gpu/drm/vc4/vc4_drv.h
15 +++ b/drivers/gpu/drm/vc4/vc4_drv.h
16 @@ -76,7 +76,6 @@ struct vc4_dev {
17 bool firmware_kms;
18 struct rpi_firmware *firmware;
19
20 - struct vc4_hdmi *hdmi;
21 struct vc4_hvs *hvs;
22 struct vc4_v3d *v3d;
23 struct vc4_dpi *dpi;
24 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c
25 +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
26 @@ -1200,7 +1200,6 @@ static int vc4_hdmi_bind(struct device *
27 #endif
28 struct platform_device *pdev = to_platform_device(dev);
29 struct drm_device *drm = dev_get_drvdata(master);
30 - struct vc4_dev *vc4 = drm->dev_private;
31 struct vc4_hdmi *vc4_hdmi;
32 struct drm_encoder *encoder;
33 struct device_node *ddc_node;
34 @@ -1288,8 +1287,6 @@ static int vc4_hdmi_bind(struct device *
35 vc4_hdmi->hpd_active_low = hpd_gpio_flags & OF_GPIO_ACTIVE_LOW;
36 }
37
38 - vc4->hdmi = vc4_hdmi;
39 -
40 /* HDMI core must be enabled. */
41 if (!(HD_READ(VC4_HD_M_CTL) & VC4_HD_M_ENABLE)) {
42 HD_WRITE(VC4_HD_M_CTL, VC4_HD_M_SW_RST);
43 @@ -1370,9 +1367,12 @@ err_put_i2c:
44 static void vc4_hdmi_unbind(struct device *dev, struct device *master,
45 void *data)
46 {
47 - struct drm_device *drm = dev_get_drvdata(master);
48 - struct vc4_dev *vc4 = drm->dev_private;
49 - struct vc4_hdmi *vc4_hdmi = vc4->hdmi;
50 + /*
51 + * snd_soc_register_card will set the device drvdata pointer
52 + * to the card being registered.
53 + */
54 + struct snd_soc_card *card = dev_get_drvdata(dev);
55 + struct vc4_hdmi *vc4_hdmi = snd_soc_card_get_drvdata(card);
56
57 cec_unregister_adapter(vc4_hdmi->cec_adap);
58 vc4_hdmi_connector_destroy(&vc4_hdmi->connector.base);
59 @@ -1382,8 +1382,6 @@ static void vc4_hdmi_unbind(struct devic
60 pm_runtime_disable(dev);
61
62 put_device(&vc4_hdmi->ddc->dev);
63 -
64 - vc4->hdmi = NULL;
65 }
66
67 static const struct component_ops vc4_hdmi_ops = {