Commit 5168a575 authored by Martin Kepplinger's avatar Martin Kepplinger Committed by Dorota Czaplejewicz
Browse files

hi846: clean up start_streaming error paths

parent 24467b3f
......@@ -1016,33 +1016,31 @@ static int hi846_start_streaming(struct hi846 *hi846)
ret = hi846_write_reg_list(hi846, &hi846_init_regs_list_4lane);
if (ret) {
dev_err(&client->dev, "failed to set plls: %d\n", ret);
goto out;
return ret;
}
ret = hi846_write_reg_list(hi846, &hi846->cur_mode->reg_list_config);
if (ret) {
dev_err(&client->dev, "failed to set mode: %d\n", ret);
goto out;
return ret;
}
if (hi846->nr_lanes == 2) {
if (!&hi846->cur_mode->reg_list_2lane) {
dev_err(&client->dev, "2 lanes unsupported for this mode\n");
ret = -EINVAL;
goto out;
return -EINVAL;
}
ret = hi846_write_reg_list(hi846, &hi846->cur_mode->reg_list_2lane);
} else {
if (!&hi846->cur_mode->reg_list_4lane) {
dev_err(&client->dev, "4 lanes unsupported for this mode\n");
ret = -EINVAL;
goto out;
return -EINVAL;
}
ret = hi846_write_reg_list(hi846, &hi846->cur_mode->reg_list_4lane);
}
if (ret) {
dev_err(&client->dev, "failed to set mipi mode: %d\n", ret);
goto out;
return ret;
}
hi846_set_video_mode(hi846, hi846->cur_mode->fps);
......@@ -1054,13 +1052,13 @@ static int hi846_start_streaming(struct hi846 *hi846)
ret = hi846_write_reg_list(hi846, hi846->debug_regs);
if (ret) {
dev_err(&client->dev, "failed to write debug regs: %d\n", ret);
goto out;
return ret;
}
}
ret = __v4l2_ctrl_handler_setup(hi846->sd.ctrl_handler);
if (ret)
goto out;
return ret;
/*
* Reading 0x0034 is purely done for debugging reasons: It is not
......@@ -1072,7 +1070,7 @@ static int hi846_start_streaming(struct hi846 *hi846)
*/
ret = hi846_read_reg(hi846, 0x0034, &val);
if (ret)
goto out;
return ret;
if (!(val & BIT(2)))
dev_info(&client->dev, "visible pixel width and height is 0\n");
......@@ -1080,13 +1078,13 @@ static int hi846_start_streaming(struct hi846 *hi846)
HI846_MODE_STREAMING);
if (ret) {
dev_err(&client->dev, "failed to start stream");
goto out;
return ret;
}
hi846->streaming = 1;
dev_dbg(&client->dev, "%s: started streaming successfully\n", __func__);
out:
return ret;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment