aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/v4l2-common.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2010-05-01 07:03:24 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-05-19 11:58:54 -0400
commitffb4877ba013f94322083f77cbb05b35c2a218aa (patch)
tree0d041da73986e1dc7c845ff4418fb20f46bd7506 /drivers/media/video/v4l2-common.c
parent530d2d32068eaf3616e0ce9e58a5fde5701c3380 (diff)
V4L/DVB: v4l2-common: simplify prio utility functions
v4l2_prio_init/open/close returned an int when in fact they would always return 0. Make these void functions. v4l2_prio_close and v4l2_prio_check pass an enum v4l2_priority as a pointer for no good reason. Replace with a normal enum v4l2_priority argument. These changes will simplify the work of moving priority handling into the v4l core. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/v4l2-common.c')
-rw-r--r--drivers/media/video/v4l2-common.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/drivers/media/video/v4l2-common.c b/drivers/media/video/v4l2-common.c
index 035c414507a1..4e53b0b3339c 100644
--- a/drivers/media/video/v4l2-common.c
+++ b/drivers/media/video/v4l2-common.c
@@ -88,10 +88,9 @@ MODULE_LICENSE("GPL");
88 val == V4L2_PRIORITY_INTERACTIVE || \ 88 val == V4L2_PRIORITY_INTERACTIVE || \
89 val == V4L2_PRIORITY_RECORD) 89 val == V4L2_PRIORITY_RECORD)
90 90
91int v4l2_prio_init(struct v4l2_prio_state *global) 91void v4l2_prio_init(struct v4l2_prio_state *global)
92{ 92{
93 memset(global,0,sizeof(*global)); 93 memset(global, 0, sizeof(*global));
94 return 0;
95} 94}
96EXPORT_SYMBOL(v4l2_prio_init); 95EXPORT_SYMBOL(v4l2_prio_init);
97 96
@@ -111,17 +110,16 @@ int v4l2_prio_change(struct v4l2_prio_state *global, enum v4l2_priority *local,
111} 110}
112EXPORT_SYMBOL(v4l2_prio_change); 111EXPORT_SYMBOL(v4l2_prio_change);
113 112
114int v4l2_prio_open(struct v4l2_prio_state *global, enum v4l2_priority *local) 113void v4l2_prio_open(struct v4l2_prio_state *global, enum v4l2_priority *local)
115{ 114{
116 return v4l2_prio_change(global,local,V4L2_PRIORITY_DEFAULT); 115 v4l2_prio_change(global, local, V4L2_PRIORITY_DEFAULT);
117} 116}
118EXPORT_SYMBOL(v4l2_prio_open); 117EXPORT_SYMBOL(v4l2_prio_open);
119 118
120int v4l2_prio_close(struct v4l2_prio_state *global, enum v4l2_priority *local) 119void v4l2_prio_close(struct v4l2_prio_state *global, enum v4l2_priority local)
121{ 120{
122 if (V4L2_PRIO_VALID(*local)) 121 if (V4L2_PRIO_VALID(local))
123 atomic_dec(&global->prios[*local]); 122 atomic_dec(&global->prios[local]);
124 return 0;
125} 123}
126EXPORT_SYMBOL(v4l2_prio_close); 124EXPORT_SYMBOL(v4l2_prio_close);
127 125
@@ -137,11 +135,9 @@ enum v4l2_priority v4l2_prio_max(struct v4l2_prio_state *global)
137} 135}
138EXPORT_SYMBOL(v4l2_prio_max); 136EXPORT_SYMBOL(v4l2_prio_max);
139 137
140int v4l2_prio_check(struct v4l2_prio_state *global, enum v4l2_priority *local) 138int v4l2_prio_check(struct v4l2_prio_state *global, enum v4l2_priority local)
141{ 139{
142 if (*local < v4l2_prio_max(global)) 140 return (local < v4l2_prio_max(global)) ? -EBUSY : 0;
143 return -EBUSY;
144 return 0;
145} 141}
146EXPORT_SYMBOL(v4l2_prio_check); 142EXPORT_SYMBOL(v4l2_prio_check);
147 143