aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/usbvision
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2008-07-20 05:35:02 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-07-23 15:42:52 -0400
commit22a04f106346c3af019135f2de3cabf9ac41c3ba (patch)
tree520b5260c3883f153cb55192f7df92899fbd062e /drivers/media/video/usbvision
parent5e85e732f0ed56aa97a3ba26ac2b93ffe597a208 (diff)
V4L/DVB (8429): videodev: renamed 'class_dev' to 'dev'
The class_dev field is a normal device, not a class device. This is very confusing and now that the old 'dev' field has been renamed to 'parent' we can rename 'class_dev' to just 'dev'. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/usbvision')
-rw-r--r--drivers/media/video/usbvision/usbvision-video.c72
1 files changed, 27 insertions, 45 deletions
diff --git a/drivers/media/video/usbvision/usbvision-video.c b/drivers/media/video/usbvision/usbvision-video.c
index 899906d954a..2ddfaa34e6b 100644
--- a/drivers/media/video/usbvision/usbvision-video.c
+++ b/drivers/media/video/usbvision/usbvision-video.c
@@ -184,7 +184,7 @@ MODULE_ALIAS(DRIVER_ALIAS);
184static inline struct usb_usbvision *cd_to_usbvision(struct device *cd) 184static inline struct usb_usbvision *cd_to_usbvision(struct device *cd)
185{ 185{
186 struct video_device *vdev = 186 struct video_device *vdev =
187 container_of(cd, struct video_device, class_dev); 187 container_of(cd, struct video_device, dev);
188 return video_get_drvdata(vdev); 188 return video_get_drvdata(vdev);
189} 189}
190 190
@@ -199,7 +199,7 @@ static ssize_t show_model(struct device *cd,
199 struct device_attribute *attr, char *buf) 199 struct device_attribute *attr, char *buf)
200{ 200{
201 struct video_device *vdev = 201 struct video_device *vdev =
202 container_of(cd, struct video_device, class_dev); 202 container_of(cd, struct video_device, dev);
203 struct usb_usbvision *usbvision = video_get_drvdata(vdev); 203 struct usb_usbvision *usbvision = video_get_drvdata(vdev);
204 return sprintf(buf, "%s\n", 204 return sprintf(buf, "%s\n",
205 usbvision_device_data[usbvision->DevModel].ModelString); 205 usbvision_device_data[usbvision->DevModel].ModelString);
@@ -210,7 +210,7 @@ static ssize_t show_hue(struct device *cd,
210 struct device_attribute *attr, char *buf) 210 struct device_attribute *attr, char *buf)
211{ 211{
212 struct video_device *vdev = 212 struct video_device *vdev =
213 container_of(cd, struct video_device, class_dev); 213 container_of(cd, struct video_device, dev);
214 struct usb_usbvision *usbvision = video_get_drvdata(vdev); 214 struct usb_usbvision *usbvision = video_get_drvdata(vdev);
215 struct v4l2_control ctrl; 215 struct v4l2_control ctrl;
216 ctrl.id = V4L2_CID_HUE; 216 ctrl.id = V4L2_CID_HUE;
@@ -225,7 +225,7 @@ static ssize_t show_contrast(struct device *cd,
225 struct device_attribute *attr, char *buf) 225 struct device_attribute *attr, char *buf)
226{ 226{
227 struct video_device *vdev = 227 struct video_device *vdev =
228 container_of(cd, struct video_device, class_dev); 228 container_of(cd, struct video_device, dev);
229 struct usb_usbvision *usbvision = video_get_drvdata(vdev); 229 struct usb_usbvision *usbvision = video_get_drvdata(vdev);
230 struct v4l2_control ctrl; 230 struct v4l2_control ctrl;
231 ctrl.id = V4L2_CID_CONTRAST; 231 ctrl.id = V4L2_CID_CONTRAST;
@@ -240,7 +240,7 @@ static ssize_t show_brightness(struct device *cd,
240 struct device_attribute *attr, char *buf) 240 struct device_attribute *attr, char *buf)
241{ 241{
242 struct video_device *vdev = 242 struct video_device *vdev =
243 container_of(cd, struct video_device, class_dev); 243 container_of(cd, struct video_device, dev);
244 struct usb_usbvision *usbvision = video_get_drvdata(vdev); 244 struct usb_usbvision *usbvision = video_get_drvdata(vdev);
245 struct v4l2_control ctrl; 245 struct v4l2_control ctrl;
246 ctrl.id = V4L2_CID_BRIGHTNESS; 246 ctrl.id = V4L2_CID_BRIGHTNESS;
@@ -255,7 +255,7 @@ static ssize_t show_saturation(struct device *cd,
255 struct device_attribute *attr, char *buf) 255 struct device_attribute *attr, char *buf)
256{ 256{
257 struct video_device *vdev = 257 struct video_device *vdev =
258 container_of(cd, struct video_device, class_dev); 258 container_of(cd, struct video_device, dev);
259 struct usb_usbvision *usbvision = video_get_drvdata(vdev); 259 struct usb_usbvision *usbvision = video_get_drvdata(vdev);
260 struct v4l2_control ctrl; 260 struct v4l2_control ctrl;
261 ctrl.id = V4L2_CID_SATURATION; 261 ctrl.id = V4L2_CID_SATURATION;
@@ -270,7 +270,7 @@ static ssize_t show_streaming(struct device *cd,
270 struct device_attribute *attr, char *buf) 270 struct device_attribute *attr, char *buf)
271{ 271{
272 struct video_device *vdev = 272 struct video_device *vdev =
273 container_of(cd, struct video_device, class_dev); 273 container_of(cd, struct video_device, dev);
274 struct usb_usbvision *usbvision = video_get_drvdata(vdev); 274 struct usb_usbvision *usbvision = video_get_drvdata(vdev);
275 return sprintf(buf, "%s\n", 275 return sprintf(buf, "%s\n",
276 YES_NO(usbvision->streaming==Stream_On?1:0)); 276 YES_NO(usbvision->streaming==Stream_On?1:0));
@@ -281,7 +281,7 @@ static ssize_t show_compression(struct device *cd,
281 struct device_attribute *attr, char *buf) 281 struct device_attribute *attr, char *buf)
282{ 282{
283 struct video_device *vdev = 283 struct video_device *vdev =
284 container_of(cd, struct video_device, class_dev); 284 container_of(cd, struct video_device, dev);
285 struct usb_usbvision *usbvision = video_get_drvdata(vdev); 285 struct usb_usbvision *usbvision = video_get_drvdata(vdev);
286 return sprintf(buf, "%s\n", 286 return sprintf(buf, "%s\n",
287 YES_NO(usbvision->isocMode==ISOC_MODE_COMPRESS)); 287 YES_NO(usbvision->isocMode==ISOC_MODE_COMPRESS));
@@ -292,7 +292,7 @@ static ssize_t show_device_bridge(struct device *cd,
292 struct device_attribute *attr, char *buf) 292 struct device_attribute *attr, char *buf)
293{ 293{
294 struct video_device *vdev = 294 struct video_device *vdev =
295 container_of(cd, struct video_device, class_dev); 295 container_of(cd, struct video_device, dev);
296 struct usb_usbvision *usbvision = video_get_drvdata(vdev); 296 struct usb_usbvision *usbvision = video_get_drvdata(vdev);
297 return sprintf(buf, "%d\n", usbvision->bridgeType); 297 return sprintf(buf, "%d\n", usbvision->bridgeType);
298} 298}
@@ -304,40 +304,31 @@ static void usbvision_create_sysfs(struct video_device *vdev)
304 if (!vdev) 304 if (!vdev)
305 return; 305 return;
306 do { 306 do {
307 res = device_create_file(&vdev->class_dev, 307 res = device_create_file(&vdev->dev, &dev_attr_version);
308 &dev_attr_version);
309 if (res<0) 308 if (res<0)
310 break; 309 break;
311 res = device_create_file(&vdev->class_dev, 310 res = device_create_file(&vdev->dev, &dev_attr_model);
312 &dev_attr_model);
313 if (res<0) 311 if (res<0)
314 break; 312 break;
315 res = device_create_file(&vdev->class_dev, 313 res = device_create_file(&vdev->dev, &dev_attr_hue);
316 &dev_attr_hue);
317 if (res<0) 314 if (res<0)
318 break; 315 break;
319 res = device_create_file(&vdev->class_dev, 316 res = device_create_file(&vdev->dev, &dev_attr_contrast);
320 &dev_attr_contrast);
321 if (res<0) 317 if (res<0)
322 break; 318 break;
323 res = device_create_file(&vdev->class_dev, 319 res = device_create_file(&vdev->dev, &dev_attr_brightness);
324 &dev_attr_brightness);
325 if (res<0) 320 if (res<0)
326 break; 321 break;
327 res = device_create_file(&vdev->class_dev, 322 res = device_create_file(&vdev->dev, &dev_attr_saturation);
328 &dev_attr_saturation);
329 if (res<0) 323 if (res<0)
330 break; 324 break;
331 res = device_create_file(&vdev->class_dev, 325 res = device_create_file(&vdev->dev, &dev_attr_streaming);
332 &dev_attr_streaming);
333 if (res<0) 326 if (res<0)
334 break; 327 break;
335 res = device_create_file(&vdev->class_dev, 328 res = device_create_file(&vdev->dev, &dev_attr_compression);
336 &dev_attr_compression);
337 if (res<0) 329 if (res<0)
338 break; 330 break;
339 res = device_create_file(&vdev->class_dev, 331 res = device_create_file(&vdev->dev, &dev_attr_bridge);
340 &dev_attr_bridge);
341 if (res>=0) 332 if (res>=0)
342 return; 333 return;
343 } while (0); 334 } while (0);
@@ -348,24 +339,15 @@ static void usbvision_create_sysfs(struct video_device *vdev)
348static void usbvision_remove_sysfs(struct video_device *vdev) 339static void usbvision_remove_sysfs(struct video_device *vdev)
349{ 340{
350 if (vdev) { 341 if (vdev) {
351 device_remove_file(&vdev->class_dev, 342 device_remove_file(&vdev->dev, &dev_attr_version);
352 &dev_attr_version); 343 device_remove_file(&vdev->dev, &dev_attr_model);
353 device_remove_file(&vdev->class_dev, 344 device_remove_file(&vdev->dev, &dev_attr_hue);
354 &dev_attr_model); 345 device_remove_file(&vdev->dev, &dev_attr_contrast);
355 device_remove_file(&vdev->class_dev, 346 device_remove_file(&vdev->dev, &dev_attr_brightness);
356 &dev_attr_hue); 347 device_remove_file(&vdev->dev, &dev_attr_saturation);
357 device_remove_file(&vdev->class_dev, 348 device_remove_file(&vdev->dev, &dev_attr_streaming);
358 &dev_attr_contrast); 349 device_remove_file(&vdev->dev, &dev_attr_compression);
359 device_remove_file(&vdev->class_dev, 350 device_remove_file(&vdev->dev, &dev_attr_bridge);
360 &dev_attr_brightness);
361 device_remove_file(&vdev->class_dev,
362 &dev_attr_saturation);
363 device_remove_file(&vdev->class_dev,
364 &dev_attr_streaming);
365 device_remove_file(&vdev->class_dev,
366 &dev_attr_compression);
367 device_remove_file(&vdev->class_dev,
368 &dev_attr_bridge);
369 } 351 }
370} 352}
371 353