summaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
authorHans Verkuil2008-07-17 21:45:00 +0200
committerMauro Carvalho Chehab2008-07-20 12:28:32 +0200
commit2bc93aa304f10bf94c377a487b09df75eaf88ab6 (patch)
tree705573cee5d10f0aac7b7c80b781cade4a6342aa /drivers/media/video
parentV4L/DVB (8381): ov7670: fix compile warnings (diff)
downloadkernel-qcow2-linux-2bc93aa304f10bf94c377a487b09df75eaf88ab6.tar.gz
kernel-qcow2-linux-2bc93aa304f10bf94c377a487b09df75eaf88ab6.tar.xz
kernel-qcow2-linux-2bc93aa304f10bf94c377a487b09df75eaf88ab6.zip
V4L/DVB (8387): Some cosmetic changes
Those changes, together with some proper patches, will allow out-of-tree compilation for for kernels < 2.6.19 Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/videodev.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/drivers/media/video/videodev.c b/drivers/media/video/videodev.c
index d54ca6c802db..c24d91897099 100644
--- a/drivers/media/video/videodev.c
+++ b/drivers/media/video/videodev.c
@@ -392,6 +392,12 @@ static ssize_t show_name(struct device *cd,
return sprintf(buf, "%.*s\n", (int)sizeof(vfd->name), vfd->name);
}
+static struct device_attribute video_device_attrs[] = {
+ __ATTR(name, S_IRUGO, show_name, NULL),
+ __ATTR(index, S_IRUGO, show_index, NULL),
+ __ATTR_NULL
+};
+
struct video_device *video_device_alloc(void)
{
struct video_device *vfd;
@@ -420,12 +426,6 @@ static void video_release(struct device *cd)
vfd->release(vfd);
}
-static struct device_attribute video_device_attrs[] = {
- __ATTR(name, S_IRUGO, show_name, NULL),
- __ATTR(index, S_IRUGO, show_index, NULL),
- __ATTR_NULL
-};
-
static struct class video_class = {
.name = VIDEO_NAME,
.dev_attrs = video_device_attrs,
@@ -2173,8 +2173,7 @@ int video_register_device_index(struct video_device *vfd, int type, int nr,
ret = get_index(vfd, index);
if (ret < 0) {
- printk(KERN_ERR "%s: get_index failed\n",
- __func__);
+ printk(KERN_ERR "%s: get_index failed\n", __func__);
goto fail_minor;
}
@@ -2185,15 +2184,14 @@ int video_register_device_index(struct video_device *vfd, int type, int nr,
/* sysfs class */
memset(&vfd->class_dev, 0x00, sizeof(vfd->class_dev));
- if (vfd->dev)
- vfd->class_dev.parent = vfd->dev;
vfd->class_dev.class = &video_class;
vfd->class_dev.devt = MKDEV(VIDEO_MAJOR, vfd->minor);
+ if (vfd->dev)
+ vfd->class_dev.parent = vfd->dev;
sprintf(vfd->class_dev.bus_id, "%s%d", name_base, i - base);
ret = device_register(&vfd->class_dev);
if (ret < 0) {
- printk(KERN_ERR "%s: device_register failed\n",
- __func__);
+ printk(KERN_ERR "%s: device_register failed\n", __func__);
goto fail_minor;
}