drm/vc4: hdmi: Deal with multiple debugfs files
authorMaxime Ripard <maxime@cerno.tech>
Thu, 16 Jan 2020 13:27:56 +0000 (14:27 +0100)
committerpopcornmix <popcornmix@gmail.com>
Wed, 1 Jul 2020 15:33:40 +0000 (16:33 +0100)
The HDMI driver was registering a single debugfs file so far with the name
hdmi_regs.

Obviously, this is not going to work anymore when will have multiple HDMI
controllers since we will end up trying to register two files with the same
name.

Let's use the ID to avoid that name conflict.

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

index 362903a..b754b7e 100644 (file)
@@ -1380,7 +1380,10 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data)
        if (ret)
                goto err_destroy_encoder;
 
-       vc4_debugfs_add_file(drm, "hdmi_regs", vc4_hdmi_debugfs_regs, vc4_hdmi);
+       vc4_debugfs_add_file(drm,
+                            variant->id ? "hdmi1_regs" : "hdmi_regs",
+                            vc4_hdmi_debugfs_regs,
+                            vc4_hdmi);
 
        return 0;