diff mbox

[1/1] video: imxfb: Driver depends on status of LCD class device

Message ID 1395933636-15704-1-git-send-email-gcembed@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

gcembed March 27, 2014, 3:20 p.m. UTC
If LCD_CLASS_DEVICE is disabled, symbol devm_lcd_device_register is
undefined

Signed-off-by: Gaƫtan Carlier <gcembed@gmail.com>
---
 drivers/video/fbdev/imxfb.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
diff mbox

Patch

diff --git a/drivers/video/fbdev/imxfb.c b/drivers/video/fbdev/imxfb.c
index f6e6216..b979b61 100644
--- a/drivers/video/fbdev/imxfb.c
+++ b/drivers/video/fbdev/imxfb.c
@@ -30,7 +30,9 @@ 
 #include <linux/platform_device.h>
 #include <linux/dma-mapping.h>
 #include <linux/io.h>
+#ifdef CONFIG_LCD_CLASS_DEVICE
 #include <linux/lcd.h>
+#endif
 #include <linux/math64.h>
 #include <linux/of.h>
 #include <linux/of_device.h>
@@ -718,6 +720,7 @@  static int imxfb_of_read_mode(struct device *dev, struct device_node *np,
 	return 0;
 }
 
+#ifdef CONFIG_LCD_CLASS_DEVICE
 static int imxfb_lcd_check_fb(struct lcd_device *lcddev, struct fb_info *fi)
 {
 	struct imxfb_info *fbi = dev_get_drvdata(&lcddev->dev);
@@ -785,6 +788,7 @@  static struct lcd_ops imxfb_lcd_ops = {
 	.get_power	= imxfb_lcd_get_power,
 	.set_power	= imxfb_lcd_set_power,
 };
+#endif
 
 static int imxfb_setup(void)
 {
@@ -809,7 +813,9 @@  static int imxfb_setup(void)
 static int imxfb_probe(struct platform_device *pdev)
 {
 	struct imxfb_info *fbi;
+#ifdef CONFIG_LCD_CLASS_DEVICE
 	struct lcd_device *lcd;
+#endif
 	struct fb_info *info;
 	struct imx_fb_platform_data *pdata;
 	struct resource *res;
@@ -967,6 +973,7 @@  static int imxfb_probe(struct platform_device *pdev)
 		goto failed_lcd;
 	}
 
+#ifdef CONFIG_LCD_CLASS_DEVICE
 	lcd = devm_lcd_device_register(&pdev->dev, "imxfb-lcd", &pdev->dev, fbi,
 				       &imxfb_lcd_ops);
 	if (IS_ERR(lcd)) {
@@ -975,6 +982,7 @@  static int imxfb_probe(struct platform_device *pdev)
 	}
 
 	lcd->props.max_contrast = 0xff;
+#endif
 
 	imxfb_enable_controller(fbi);
 	fbi->pdev = pdev;