video: tegra: dsi: fix regulator warning condition
Kerwin Wan [Mon, 23 Jun 2014 06:38:48 +0000 (14:38 +0800)]
The regulator warning message should come up only when
the regulator fails to be enabled.

Change-Id: Ia03af22281bf4d7a68a19b623d18754dc2512e6d
Signed-off-by: Kerwin Wan <kerwinw@nvidia.com>
Reviewed-on: http://git-master/r/427043
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>

drivers/video/tegra/dc/dsi.c

index bf8d0d3..681a63c 100644 (file)
@@ -3829,12 +3829,14 @@ static void tegra_dsi_send_dc_frames(struct tegra_dc *dc,
 
 static void tegra_dsi_setup_initialized_panel(struct tegra_dc_dsi_data *dsi)
 {
-       int err = 0;
+       int err;
 
-       if (dsi->avdd_dsi_csi)
+       if (dsi->avdd_dsi_csi) {
                err = regulator_enable(dsi->avdd_dsi_csi);
-       dev_warn(&dsi->dc->ndev->dev,
-               "unable to enable regulator err = %d", err);
+               if (err)
+                       dev_warn(&dsi->dc->ndev->dev,
+                               "unable to enable regulator err = %d", err);
+       }
 
        dsi->status.init = DSI_MODULE_INIT;