backports: backport new sysfs api in media
authorHauke Mehrtens <hauke@hauke-m.de>
Wed, 18 Sep 2013 21:16:32 +0000 (23:16 +0200)
committerHauke Mehrtens <hauke@hauke-m.de>
Mon, 21 Oct 2013 21:58:37 +0000 (23:58 +0200)
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
patches/collateral-evolutions/media/0004-sysfs-api.patch [new file with mode: 0644]

diff --git a/patches/collateral-evolutions/media/0004-sysfs-api.patch b/patches/collateral-evolutions/media/0004-sysfs-api.patch
new file mode 100644 (file)
index 0000000..1fcc610
--- /dev/null
@@ -0,0 +1,32 @@
+diff --git a/drivers/media/v4l2-core/v4l2-dev.c b/drivers/media/v4l2-core/v4l2-dev.c
+index b0f49b0..461e3e1 100644
+--- a/drivers/media/v4l2-core/v4l2-dev.c
++++ b/drivers/media/v4l2-core/v4l2-dev.c
+@@ -86,6 +86,7 @@ static struct attribute *video_device_at
+       &dev_attr_index.attr,
+       NULL,
+ };
++#define BP_ATTR_GRP_STRUCT device_attribute
+ ATTRIBUTE_GROUPS(video_device);
+ /*
+@@ -221,7 +222,11 @@ static void v4l2_device_release(struct d
+ static struct class video_class = {
+       .name = VIDEO_NAME,
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)
+       .dev_groups = video_device_groups,
++#else
++      .dev_attrs = video_device_dev_attrs,
++#endif
+ };
+ struct video_device *video_devdata(struct file *file)
+@@ -991,6 +996,7 @@ static int __init videodev_init(void)
+               return ret;
+       }
++      init_video_device_attrs();
+       ret = class_register(&video_class);
+       if (ret < 0) {
+               unregister_chrdev_region(dev, VIDEO_NUM_DEVICES);