[PATCH 3/3] viafb: Don't build in camera-specific code without the camera

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Bruno noted that the camera subdev was being created even in the absence of
the camera module; stop that.  While I was at it, I also put an #ifdef
guard around the DMA code.  Viafb users have gotten along just fine without
that functionality so far, and only the camera uses it, so there is no
point in bloating the driver if the camera is not being built.

Reported-by: Bruno Prémont <bonbons@xxxxxxxxxxxxxxxxx>
Signed-off-by: Jonathan Corbet <corbet@xxxxxxx>
---
 drivers/video/via/via-core.c |   12 ++++++++++--
 drivers/video/via/via-core.h |    3 ++-
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/drivers/video/via/via-core.c b/drivers/video/via/via-core.c
index 1c6835e..a084363 100644
--- a/drivers/video/via/via-core.c
+++ b/drivers/video/via/via-core.c
@@ -34,7 +34,6 @@ static struct via_port_cfg adap_configs[] = {
  */
 static struct viafb_dev global_dev;
 
-
 /*
  * Basic register access; spinlock required.
  */
@@ -95,6 +94,13 @@ EXPORT_SYMBOL_GPL(viafb_irq_disable);
 
 /* ---------------------------------------------------------------------- */
 /*
+ * Currently, the camera driver is the only user of the DMA code, so we
+ * only compile it in if the camera driver is being built.  Chances are,
+ * most viafb systems will not need to have this extra code for a while.
+ * As soon as another user comes long, the ifdef can be removed.
+ */
+#if defined(CONFIG_FB_VIA_CAMERA) || defined(CONFIG_FB_VIA_CAMERA_MODULE)
+/*
  * Access to the DMA engine.  This currently provides what the camera
  * driver needs (i.e. outgoing only) but is easily expandable if need
  * be.
@@ -322,7 +328,7 @@ int viafb_dma_copy_out_sg(unsigned int offset, struct scatterlist *sg, int nsg)
 	return 0;
 }
 EXPORT_SYMBOL_GPL(viafb_dma_copy_out_sg);
-
+#endif /* CONFIG_FB_VIA_CAMERA */
 
 /* ---------------------------------------------------------------------- */
 /*
@@ -508,9 +514,11 @@ static struct viafb_subdev_info {
 	{
 		.name = "viafb-i2c",
 	},
+#if defined(CONFIG_FB_VIA_CAMERA) || defined(CONFIG_FB_VIA_CAMERA_MODULE)
 	{
 		.name = "viafb-camera",
 	},
+#endif
 };
 #define N_SUBDEVS ARRAY_SIZE(viafb_subdevs)
 
diff --git a/drivers/video/via/via-core.h b/drivers/video/via/via-core.h
index 087c562..ca52dfe 100644
--- a/drivers/video/via/via-core.h
+++ b/drivers/video/via/via-core.h
@@ -94,7 +94,6 @@ struct viafb_dev {
 /*
  * Interrupt management.
  */
-
 void viafb_irq_enable(u32 mask);
 void viafb_irq_disable(u32 mask);
 
@@ -135,6 +134,7 @@ void viafb_irq_disable(u32 mask);
 #define   VDE_I_LVDSSIEN  0x40000000  /* LVDS Sense enable */
 #define   VDE_I_ENABLE	  0x80000000  /* Global interrupt enable */
 
+#if defined(CONFIG_FB_VIA_CAMERA) || defined(CONFIG_FB_VIA_CAMERA_MODULE)
 /*
  * DMA management.
  */
@@ -169,5 +169,6 @@ int viafb_dma_copy_out_sg(unsigned int offset, struct scatterlist *sg, int nsg);
  */
 #define VGA_WIDTH	640
 #define VGA_HEIGHT	480
+#endif /* CONFIG_FB_VIA_CAMERA */
 
 #endif /* __VIA_CORE_H__ */
-- 
1.7.0.1

--
To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Video for Linux]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Tourism]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux