if (err < 0) {
dev_err(&dc->ndev->dev,
"dsi: not able to set to hs mode\n");
- return err;
+ goto fail;
}
tegra_dsi_start_dc_stream(dc, dsi);
tegra_dsi_wait_frame_end(dc, dsi, 2);
- tegra_dsi_set_to_lp_mode(dc, dsi, DSI_LP_OP_WRITE);
+ err = tegra_dsi_set_to_lp_mode(dc, dsi, DSI_LP_OP_WRITE);
+ if (err < 0) {
+ dev_err(&dc->ndev->dev,
+ "dsi: not able to set to lp mode\n");
+ goto fail;
+ }
}
+ fail:
tegra_dc_dsi_release_host(dc);
tegra_dc_io_end(dc);
- return 0;
+ return err;
}
EXPORT_SYMBOL(tegra_dsi_start_host_cmd_v_blank_video);
struct tegra_dc_dsi_data *dsi = s->private;
struct tegra_dc *dc = dsi->dc;
- sscanf(buf, "%x %x", &max_ret_payload_size, &panel_reg_addr);
- dev_info(&dc->ndev->dev, "max ret payload size:0x%x\npanel reg addr:0x%x\n",
- max_ret_payload_size, panel_reg_addr);
+ if (sscanf(buf, "%x %x", &max_ret_payload_size, &panel_reg_addr) != 2)
+ return -EINVAL;
+ dev_info(&dc->ndev->dev, "max ret payload size:0x%x\npanel reg addr:0x%x\n",
+ max_ret_payload_size, panel_reg_addr);
return count;
}
return count;
}
- sscanf(buf, "%x %x %x", &data_id, &command_value, &command_value1);
+ if (sscanf(buf, "%x %x %x", &data_id, &command_value, &command_value1)
+ != 3)
+ return -EINVAL;
dev_info(&dc->ndev->dev, "data id taken :0x%x\n", data_id);
dev_info(&dc->ndev->dev, "command value taken :0x%x\n", command_value);
dev_info(&dc->ndev->dev, "second command value taken :0x%x\n",
struct tegra_dc_dsi_data *dsi = s->private;
struct tegra_dc *dc = dsi->dc;
- sscanf(buf, "%x %x %x", &data_id,
- &command_value, &command_value1);
+ if (sscanf(buf, "%x %x %x", &data_id,
+ &command_value, &command_value1) != 3)
+ return -EINVAL;
dev_info(&dc->ndev->dev, "data_id taken :0x%x\n", data_id);
dev_info(&dc->ndev->dev, "command value taken :0x%x\n", command_value);
dev_info(&dc->ndev->dev, "second command value taken :0x%x\n",