Commit 0c90f649 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

media: vivid: add vivid_create_queue() helper

Refactor some of the vivid_create_instance code by using a
new vivid_create_queue() helper function.

Also add some sanity checks for the node_types vs input/output_types
module options.

This patch resolves these two smatch parse errors:

drivers/media/platform/vivid/vivid-core.c:1679 vivid_create_instance() parse error: OOM: 3002600Kb sm_state_count = 6160113
drivers/media/platform/vivid/vivid-core.c: drivers/media/platform/vivid/vivid-core.c:1679
vivid_create_instance() parse error: __split_smt: function too hairy.  Giving up after 33 seconds
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 13183724
...@@ -276,12 +276,11 @@ struct cec_adapter *vivid_cec_alloc_adap(struct vivid_dev *dev, ...@@ -276,12 +276,11 @@ struct cec_adapter *vivid_cec_alloc_adap(struct vivid_dev *dev,
unsigned int idx, unsigned int idx,
bool is_source) bool is_source)
{ {
char name[sizeof(dev->vid_out_dev.name) + 2];
u32 caps = CEC_CAP_DEFAULTS | CEC_CAP_MONITOR_ALL | CEC_CAP_MONITOR_PIN; u32 caps = CEC_CAP_DEFAULTS | CEC_CAP_MONITOR_ALL | CEC_CAP_MONITOR_PIN;
char name[32];
snprintf(name, sizeof(name), "%s%d", snprintf(name, sizeof(name), "vivid-%03d-vid-%s%d",
is_source ? dev->vid_out_dev.name : dev->vid_cap_dev.name, dev->inst, is_source ? "out" : "cap", idx);
idx);
return cec_allocate_adapter(&vivid_cec_adap_ops, dev, return cec_allocate_adapter(&vivid_cec_adap_ops, dev,
name, caps, 1); name, caps, 1);
} }
This diff is collapsed.
...@@ -200,6 +200,7 @@ struct vivid_dev { ...@@ -200,6 +200,7 @@ struct vivid_dev {
bool has_fb; bool has_fb;
bool has_meta_cap; bool has_meta_cap;
bool has_meta_out; bool has_meta_out;
bool has_tv_tuner;
bool can_loop_video; bool can_loop_video;
......
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