]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - android-sdk/kernel-video.git/commitdiff
omapdss: TFCS panel: Check for successful TLC driver registration before using it
authorArchit Taneja <archit@ti.com>
Wed, 5 Jun 2013 11:03:54 +0000 (16:33 +0530)
committerArchit Taneja <archit@ti.com>
Wed, 5 Jun 2013 11:04:52 +0000 (16:34 +0530)
The TFCS panel driver internally uses the TLC brightness controller/gpio chip
to configure the panel. The TLC i2c driver is registered first following the
registration of the omapdss TFCS panel driver.

Currently, the TFCS panel driver can regsiter successfully even if the TLC
driver isn't probed successfully. Add a check in the TFCS driver probe if the
TLC i2c client device has a valid driver attached to it.

This removes the crash seen on Vayu evm when the LCD daughter card isn't
connected to the main Vayu CPU board.

Signed-off-by: Archit Taneja <archit@ti.com>
drivers/video/omap2/displays/panel-tfcs9700.c

index 11b9b707aeec6fca365d67a861e9bf9473f78cb1..1bc2c087660669f1da212213dbf76cd98b7f4890 100644 (file)
@@ -184,6 +184,7 @@ static struct i2c_board_info tlc_i2c_board_info = {
 static int tfc_s9700_probe(struct omap_dss_device *dssdev)
 {
        struct panel_drv_data *ddata;
+       struct device *i2c_dev;
        int r;
 
        ddata = devm_kzalloc(&dssdev->dev, sizeof(*ddata), GFP_KERNEL);
@@ -226,6 +227,11 @@ static int tfc_s9700_probe(struct omap_dss_device *dssdev)
                return -EINVAL;
        }
 
+       i2c_dev = &ddata->tlc_client->dev;
+       if (!i2c_dev->driver) {
+               dev_err(&dssdev->dev, "tlc i2c client has no driver\n");
+               return -EINVAL;
+       }
 
        if (dssdev->phy.dpi.data_lines == 24)
                ddata->dith = 0;