]> err.no Git - linux-2.6/commitdiff
V4L/DVB (8488): videodev: remove some CONFIG_VIDEO_V4L1_COMPAT code from v4l2-dev.h
authorHans Verkuil <hverkuil@xs4all.nl>
Fri, 25 Jul 2008 10:39:54 +0000 (07:39 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Sat, 26 Jul 2008 16:18:11 +0000 (13:18 -0300)
The video_device_create_file and video_device_remove_file functions can be
removed from v4l2-dev.h, removing the dependency on videodev.h in v4l2-dev.h.

Also removed a few more videodev.h includes that should have been videodev2.h.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
12 files changed:
drivers/media/common/tuners/tda9887.c
drivers/media/common/tuners/tuner-simple.c
drivers/media/video/cpia2/cpia2_core.c
drivers/media/video/ov511.c
drivers/media/video/pwc/pwc-if.c
drivers/media/video/stk-webcam.c
drivers/media/video/stv680.c
drivers/media/video/usbvideo/vicam.c
drivers/media/video/usbvision/usbvision-core.c
drivers/media/video/usbvision/usbvision-video.c
drivers/media/video/vpx3220.c
include/media/v4l2-dev.h

index a0545ba957b05c5be756016ebb041d792088006d..72abf0b73486d19c3e69e4330b0213f1d963a9f3 100644 (file)
@@ -6,7 +6,7 @@
 #include <linux/errno.h>
 #include <linux/slab.h>
 #include <linux/delay.h>
-#include <linux/videodev.h>
+#include <linux/videodev2.h>
 #include <media/v4l2-common.h>
 #include <media/tuner.h>
 #include "tuner-i2c.h"
index 266c255cf0d89241f2332e50ea8947329d13d311..597e47f5d69cde232fbf03bc52c685785ab72fc9 100644 (file)
@@ -6,7 +6,7 @@
  */
 #include <linux/delay.h>
 #include <linux/i2c.h>
-#include <linux/videodev.h>
+#include <linux/videodev2.h>
 #include <media/tuner.h>
 #include <media/v4l2-common.h>
 #include <media/tuner-types.h>
index f2e8b1c82c66da6e10a347f1195950ed9ba6d3d4..af8b9ec8e3587bd64ff37cf2c29a4df1fe5118fa 100644 (file)
@@ -32,6 +32,7 @@
 #include "cpia2.h"
 
 #include <linux/slab.h>
+#include <linux/mm.h>
 #include <linux/vmalloc.h>
 #include <linux/firmware.h>
 
index f732b035570fdde01f1b5f9d9e834dbb150d4610..2374ebc084d4432d17ff47735f6c99c866999809 100644 (file)
@@ -5660,43 +5660,43 @@ static int ov_create_sysfs(struct video_device *vdev)
 {
        int rc;
 
-       rc = video_device_create_file(vdev, &dev_attr_custom_id);
+       rc = device_create_file(&vdev->dev, &dev_attr_custom_id);
        if (rc) goto err;
-       rc = video_device_create_file(vdev, &dev_attr_model);
+       rc = device_create_file(&vdev->dev, &dev_attr_model);
        if (rc) goto err_id;
-       rc = video_device_create_file(vdev, &dev_attr_bridge);
+       rc = device_create_file(&vdev->dev, &dev_attr_bridge);
        if (rc) goto err_model;
-       rc = video_device_create_file(vdev, &dev_attr_sensor);
+       rc = device_create_file(&vdev->dev, &dev_attr_sensor);
        if (rc) goto err_bridge;
-       rc = video_device_create_file(vdev, &dev_attr_brightness);
+       rc = device_create_file(&vdev->dev, &dev_attr_brightness);
        if (rc) goto err_sensor;
-       rc = video_device_create_file(vdev, &dev_attr_saturation);
+       rc = device_create_file(&vdev->dev, &dev_attr_saturation);
        if (rc) goto err_bright;
-       rc = video_device_create_file(vdev, &dev_attr_contrast);
+       rc = device_create_file(&vdev->dev, &dev_attr_contrast);
        if (rc) goto err_sat;
-       rc = video_device_create_file(vdev, &dev_attr_hue);
+       rc = device_create_file(&vdev->dev, &dev_attr_hue);
        if (rc) goto err_contrast;
-       rc = video_device_create_file(vdev, &dev_attr_exposure);
+       rc = device_create_file(&vdev->dev, &dev_attr_exposure);
        if (rc) goto err_hue;
 
        return 0;
 
 err_hue:
-       video_device_remove_file(vdev, &dev_attr_hue);
+       device_remove_file(&vdev->dev, &dev_attr_hue);
 err_contrast:
-       video_device_remove_file(vdev, &dev_attr_contrast);
+       device_remove_file(&vdev->dev, &dev_attr_contrast);
 err_sat:
-       video_device_remove_file(vdev, &dev_attr_saturation);
+       device_remove_file(&vdev->dev, &dev_attr_saturation);
 err_bright:
-       video_device_remove_file(vdev, &dev_attr_brightness);
+       device_remove_file(&vdev->dev, &dev_attr_brightness);
 err_sensor:
-       video_device_remove_file(vdev, &dev_attr_sensor);
+       device_remove_file(&vdev->dev, &dev_attr_sensor);
 err_bridge:
-       video_device_remove_file(vdev, &dev_attr_bridge);
+       device_remove_file(&vdev->dev, &dev_attr_bridge);
 err_model:
-       video_device_remove_file(vdev, &dev_attr_model);
+       device_remove_file(&vdev->dev, &dev_attr_model);
 err_id:
-       video_device_remove_file(vdev, &dev_attr_custom_id);
+       device_remove_file(&vdev->dev, &dev_attr_custom_id);
 err:
        return rc;
 }
index 4625b265bf9828d611b48ef7ae2f5909c24b3cb2..436a47caf52dfa8555c76f840169c72b56712c30 100644 (file)
@@ -1047,19 +1047,20 @@ static int pwc_create_sysfs_files(struct video_device *vdev)
        struct pwc_device *pdev = video_get_drvdata(vdev);
        int rc;
 
-       rc = video_device_create_file(vdev, &dev_attr_button);
+       rc = device_create_file(&vdev->dev, &dev_attr_button);
        if (rc)
                goto err;
        if (pdev->features & FEATURE_MOTOR_PANTILT) {
-               rc = video_device_create_file(vdev, &dev_attr_pan_tilt);
+               rc = device_create_file(&vdev->dev, &dev_attr_pan_tilt);
                if (rc) goto err_button;
        }
 
        return 0;
 
 err_button:
-       video_device_remove_file(vdev, &dev_attr_button);
+       device_remove_file(&vdev->dev, &dev_attr_button);
 err:
+       PWC_ERROR("Could not create sysfs files.\n");
        return rc;
 }
 
@@ -1067,8 +1068,8 @@ static void pwc_remove_sysfs_files(struct video_device *vdev)
 {
        struct pwc_device *pdev = video_get_drvdata(vdev);
        if (pdev->features & FEATURE_MOTOR_PANTILT)
-               video_device_remove_file(vdev, &dev_attr_pan_tilt);
-       video_device_remove_file(vdev, &dev_attr_button);
+               device_remove_file(&vdev->dev, &dev_attr_pan_tilt);
+       device_remove_file(&vdev->dev, &dev_attr_button);
 }
 
 #ifdef CONFIG_USB_PWC_DEBUG
index 8d5fa95ad95a2375a65f6fc71df6fa3cfeccfa84..8aa56fe02546a796ac5bfbb946c2f81d0db26a2a 100644 (file)
@@ -341,17 +341,19 @@ static int stk_create_sysfs_files(struct video_device *vdev)
 {
        int ret;
 
-       ret = video_device_create_file(vdev, &dev_attr_brightness);
-       ret += video_device_create_file(vdev, &dev_attr_hflip);
-       ret += video_device_create_file(vdev, &dev_attr_vflip);
+       ret = device_create_file(&vdev->dev, &dev_attr_brightness);
+       ret += device_create_file(&vdev->dev, &dev_attr_hflip);
+       ret += device_create_file(&vdev->dev, &dev_attr_vflip);
+       if (ret)
+               STK_WARNING("Could not create sysfs files\n");
        return ret;
 }
 
 static void stk_remove_sysfs_files(struct video_device *vdev)
 {
-       video_device_remove_file(vdev, &dev_attr_brightness);
-       video_device_remove_file(vdev, &dev_attr_hflip);
-       video_device_remove_file(vdev, &dev_attr_vflip);
+       device_remove_file(&vdev->dev, &dev_attr_brightness);
+       device_remove_file(&vdev->dev, &dev_attr_hflip);
+       device_remove_file(&vdev->dev, &dev_attr_vflip);
 }
 
 #else
index fdcb58b0c12155c3fa7961b7433c54181daadc8a..9053d5a0b1c36e2848f65c3f2b9f8ff860f3472a 100644 (file)
@@ -525,53 +525,54 @@ static int stv680_create_sysfs_files(struct video_device *vdev)
 {
        int rc;
 
-       rc = video_device_create_file(vdev, &dev_attr_model);
+       rc = device_create_file(&vdev->dev, &dev_attr_model);
        if (rc) goto err;
-       rc = video_device_create_file(vdev, &dev_attr_in_use);
+       rc = device_create_file(&vdev->dev, &dev_attr_in_use);
        if (rc) goto err_model;
-       rc = video_device_create_file(vdev, &dev_attr_streaming);
+       rc = device_create_file(&vdev->dev, &dev_attr_streaming);
        if (rc) goto err_inuse;
-       rc = video_device_create_file(vdev, &dev_attr_palette);
+       rc = device_create_file(&vdev->dev, &dev_attr_palette);
        if (rc) goto err_stream;
-       rc = video_device_create_file(vdev, &dev_attr_frames_total);
+       rc = device_create_file(&vdev->dev, &dev_attr_frames_total);
        if (rc) goto err_pal;
-       rc = video_device_create_file(vdev, &dev_attr_frames_read);
+       rc = device_create_file(&vdev->dev, &dev_attr_frames_read);
        if (rc) goto err_framtot;
-       rc = video_device_create_file(vdev, &dev_attr_packets_dropped);
+       rc = device_create_file(&vdev->dev, &dev_attr_packets_dropped);
        if (rc) goto err_framread;
-       rc = video_device_create_file(vdev, &dev_attr_decoding_errors);
+       rc = device_create_file(&vdev->dev, &dev_attr_decoding_errors);
        if (rc) goto err_dropped;
 
        return 0;
 
 err_dropped:
-       video_device_remove_file(vdev, &dev_attr_packets_dropped);
+       device_remove_file(&vdev->dev, &dev_attr_packets_dropped);
 err_framread:
-       video_device_remove_file(vdev, &dev_attr_frames_read);
+       device_remove_file(&vdev->dev, &dev_attr_frames_read);
 err_framtot:
-       video_device_remove_file(vdev, &dev_attr_frames_total);
+       device_remove_file(&vdev->dev, &dev_attr_frames_total);
 err_pal:
-       video_device_remove_file(vdev, &dev_attr_palette);
+       device_remove_file(&vdev->dev, &dev_attr_palette);
 err_stream:
-       video_device_remove_file(vdev, &dev_attr_streaming);
+       device_remove_file(&vdev->dev, &dev_attr_streaming);
 err_inuse:
-       video_device_remove_file(vdev, &dev_attr_in_use);
+       device_remove_file(&vdev->dev, &dev_attr_in_use);
 err_model:
-       video_device_remove_file(vdev, &dev_attr_model);
+       device_remove_file(&vdev->dev, &dev_attr_model);
 err:
+       PDEBUG(0, "STV(e): Could not create sysfs files");
        return rc;
 }
 
 static void stv680_remove_sysfs_files(struct video_device *vdev)
 {
-       video_device_remove_file(vdev, &dev_attr_model);
-       video_device_remove_file(vdev, &dev_attr_in_use);
-       video_device_remove_file(vdev, &dev_attr_streaming);
-       video_device_remove_file(vdev, &dev_attr_palette);
-       video_device_remove_file(vdev, &dev_attr_frames_total);
-       video_device_remove_file(vdev, &dev_attr_frames_read);
-       video_device_remove_file(vdev, &dev_attr_packets_dropped);
-       video_device_remove_file(vdev, &dev_attr_decoding_errors);
+       device_remove_file(&vdev->dev, &dev_attr_model);
+       device_remove_file(&vdev->dev, &dev_attr_in_use);
+       device_remove_file(&vdev->dev, &dev_attr_streaming);
+       device_remove_file(&vdev->dev, &dev_attr_palette);
+       device_remove_file(&vdev->dev, &dev_attr_frames_total);
+       device_remove_file(&vdev->dev, &dev_attr_frames_read);
+       device_remove_file(&vdev->dev, &dev_attr_packets_dropped);
+       device_remove_file(&vdev->dev, &dev_attr_decoding_errors);
 }
 
 /********************************************************************
index e2dec6fb0da945ffbc4d9b6227e611cbb17dc6d0..b8e8fceee525dc42a0e282fd69081bfd59abc345 100644 (file)
@@ -41,6 +41,7 @@
 #include <linux/videodev.h>
 #include <linux/usb.h>
 #include <linux/vmalloc.h>
+#include <linux/mm.h>
 #include <linux/slab.h>
 #include <linux/mutex.h>
 #include <linux/firmware.h>
index 7d53de531c44a1e22fcc945100d675ca4a7b8ed7..c317ed7a8482fdbcaf47e5f7e635cc634e1cbee9 100644 (file)
@@ -30,7 +30,6 @@
 #include <linux/mm.h>
 #include <linux/utsname.h>
 #include <linux/highmem.h>
-#include <linux/videodev.h>
 #include <linux/vmalloc.h>
 #include <linux/module.h>
 #include <linux/init.h>
index e97f955aad676e6efd47c36f1a35f5b3c0dd4710..a65e5db0a3250a78cdb6d3df8bca6805707bf28c 100644 (file)
@@ -53,7 +53,6 @@
 #include <linux/mm.h>
 #include <linux/utsname.h>
 #include <linux/highmem.h>
-#include <linux/videodev.h>
 #include <linux/vmalloc.h>
 #include <linux/module.h>
 #include <linux/init.h>
index 3b83d4e2b2c390c54b801d0dd75d63cf0e70f271..35293029da02423e1c31cb1aedb136f78c6b090f 100644 (file)
@@ -33,7 +33,7 @@
 
 #define I2C_NAME(x) (x)->name
 
-#include <linux/videodev2.h>
+#include <linux/videodev.h>
 #include <media/v4l2-common.h>
 #include <linux/video_decoder.h>
 
index ae2b1e6bdf47bf1cf0427ad39e6ff67b363c0094..2fe38858516b6441c1eddd93769988f547b96cc1 100644 (file)
 #include <linux/device.h>
 #include <linux/mutex.h>
 #include <linux/compiler.h> /* need __user */
-#ifdef CONFIG_VIDEO_V4L1_COMPAT
-#include <linux/videodev.h>
-#else
 #include <linux/videodev2.h>
-#endif
 
 #define VIDEO_MAJOR    81
 /* Minor device allocation */
@@ -102,27 +98,6 @@ void video_unregister_device(struct video_device *);
 struct video_device *video_device_alloc(void);
 void video_device_release(struct video_device *vfd);
 
-#ifdef CONFIG_VIDEO_V4L1_COMPAT
-#include <linux/mm.h>
-
-static inline int __must_check
-video_device_create_file(struct video_device *vfd,
-                        struct device_attribute *attr)
-{
-       int ret = device_create_file(&vfd->dev, attr);
-       if (ret < 0)
-               printk(KERN_WARNING "%s error: %d\n", __func__, ret);
-       return ret;
-}
-static inline void
-video_device_remove_file(struct video_device *vfd,
-                        struct device_attribute *attr)
-{
-       device_remove_file(&vfd->dev, attr);
-}
-
-#endif /* CONFIG_VIDEO_V4L1_COMPAT */
-
 #ifdef OBSOLETE_DEVDATA /* to be removed soon */
 /* helper functions to access driver private data. */
 static inline void *video_get_drvdata(struct video_device *dev)