diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2010-05-01 07:03:24 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-05-19 11:58:54 -0400 |
commit | ffb4877ba013f94322083f77cbb05b35c2a218aa (patch) | |
tree | 0d041da73986e1dc7c845ff4418fb20f46bd7506 /drivers/media/video/v4l2-common.c | |
parent | 530d2d32068eaf3616e0ce9e58a5fde5701c3380 (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.c | 22 |
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 | ||
91 | int v4l2_prio_init(struct v4l2_prio_state *global) | 91 | void 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 | } |
96 | EXPORT_SYMBOL(v4l2_prio_init); | 95 | EXPORT_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 | } |
112 | EXPORT_SYMBOL(v4l2_prio_change); | 111 | EXPORT_SYMBOL(v4l2_prio_change); |
113 | 112 | ||
114 | int v4l2_prio_open(struct v4l2_prio_state *global, enum v4l2_priority *local) | 113 | void 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 | } |
118 | EXPORT_SYMBOL(v4l2_prio_open); | 117 | EXPORT_SYMBOL(v4l2_prio_open); |
119 | 118 | ||
120 | int v4l2_prio_close(struct v4l2_prio_state *global, enum v4l2_priority *local) | 119 | void 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 | } |
126 | EXPORT_SYMBOL(v4l2_prio_close); | 124 | EXPORT_SYMBOL(v4l2_prio_close); |
127 | 125 | ||
@@ -137,11 +135,9 @@ enum v4l2_priority v4l2_prio_max(struct v4l2_prio_state *global) | |||
137 | } | 135 | } |
138 | EXPORT_SYMBOL(v4l2_prio_max); | 136 | EXPORT_SYMBOL(v4l2_prio_max); |
139 | 137 | ||
140 | int v4l2_prio_check(struct v4l2_prio_state *global, enum v4l2_priority *local) | 138 | int 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 | } |
146 | EXPORT_SYMBOL(v4l2_prio_check); | 142 | EXPORT_SYMBOL(v4l2_prio_check); |
147 | 143 | ||