drm/dsi: Check for CONFIG_OF when defining of_mipi_dsi_device_add()
authorArchit Taneja <architt@codeaurora.org>
Fri, 12 Feb 2016 09:18:30 +0000 (14:48 +0530)
committerThierry Reding <treding@nvidia.com>
Wed, 2 Mar 2016 15:59:04 +0000 (16:59 +0100)
of_mipi_dsi_device_add() is used only when CONFIG_OF is enabled. It
currently works if OF support is disabled, but this will change when we
add more functionality to it.

Define the original function if CONFIG_OF is enabled and a dummy
function otherwise.

Signed-off-by: Archit Taneja <architt@codeaurora.org>
Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/gpu/drm/drm_mipi_dsi.c

index 6e6a9c58d404e40d9cf9f65924705fe7c231c5d4..4f2a70471e057da1133752ad185da783ce810f61 100644 (file)
@@ -129,6 +129,7 @@ static int mipi_dsi_device_add(struct mipi_dsi_device *dsi)
        return device_add(&dsi->dev);
 }
 
+#if IS_ENABLED(CONFIG_OF)
 static struct mipi_dsi_device *
 of_mipi_dsi_device_add(struct mipi_dsi_host *host, struct device_node *node)
 {
@@ -170,6 +171,13 @@ of_mipi_dsi_device_add(struct mipi_dsi_host *host, struct device_node *node)
 
        return dsi;
 }
+#else
+static struct mipi_dsi_device *
+of_mipi_dsi_device_add(struct mipi_dsi_host *host, struct device_node *node)
+{
+       return ERR_PTR(-ENODEV);
+}
+#endif
 
 int mipi_dsi_host_register(struct mipi_dsi_host *host)
 {
This page took 0.026137 seconds and 5 git commands to generate.