diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2008-07-17 15:45:00 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-07-20 06:28:32 -0400 |
commit | 2bc93aa304f10bf94c377a487b09df75eaf88ab6 (patch) | |
tree | 705573cee5d10f0aac7b7c80b781cade4a6342aa /drivers | |
parent | e3bf20de33b016ac73424a5574177ed46c754be3 (diff) |
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')
-rw-r--r-- | drivers/media/video/videodev.c | 22 |
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, | |||
392 | return sprintf(buf, "%.*s\n", (int)sizeof(vfd->name), vfd->name); | 392 | return sprintf(buf, "%.*s\n", (int)sizeof(vfd->name), vfd->name); |
393 | } | 393 | } |
394 | 394 | ||
395 | static struct device_attribute video_device_attrs[] = { | ||
396 | __ATTR(name, S_IRUGO, show_name, NULL), | ||
397 | __ATTR(index, S_IRUGO, show_index, NULL), | ||
398 | __ATTR_NULL | ||
399 | }; | ||
400 | |||
395 | struct video_device *video_device_alloc(void) | 401 | struct video_device *video_device_alloc(void) |
396 | { | 402 | { |
397 | struct video_device *vfd; | 403 | struct video_device *vfd; |
@@ -420,12 +426,6 @@ static void video_release(struct device *cd) | |||
420 | vfd->release(vfd); | 426 | vfd->release(vfd); |
421 | } | 427 | } |
422 | 428 | ||
423 | static struct device_attribute video_device_attrs[] = { | ||
424 | __ATTR(name, S_IRUGO, show_name, NULL), | ||
425 | __ATTR(index, S_IRUGO, show_index, NULL), | ||
426 | __ATTR_NULL | ||
427 | }; | ||
428 | |||
429 | static struct class video_class = { | 429 | static struct class video_class = { |
430 | .name = VIDEO_NAME, | 430 | .name = VIDEO_NAME, |
431 | .dev_attrs = video_device_attrs, | 431 | .dev_attrs = video_device_attrs, |
@@ -2173,8 +2173,7 @@ int video_register_device_index(struct video_device *vfd, int type, int nr, | |||
2173 | 2173 | ||
2174 | ret = get_index(vfd, index); | 2174 | ret = get_index(vfd, index); |
2175 | if (ret < 0) { | 2175 | if (ret < 0) { |
2176 | printk(KERN_ERR "%s: get_index failed\n", | 2176 | printk(KERN_ERR "%s: get_index failed\n", __func__); |
2177 | __func__); | ||
2178 | goto fail_minor; | 2177 | goto fail_minor; |
2179 | } | 2178 | } |
2180 | 2179 | ||
@@ -2185,15 +2184,14 @@ int video_register_device_index(struct video_device *vfd, int type, int nr, | |||
2185 | 2184 | ||
2186 | /* sysfs class */ | 2185 | /* sysfs class */ |
2187 | memset(&vfd->class_dev, 0x00, sizeof(vfd->class_dev)); | 2186 | memset(&vfd->class_dev, 0x00, sizeof(vfd->class_dev)); |
2188 | if (vfd->dev) | ||
2189 | vfd->class_dev.parent = vfd->dev; | ||
2190 | vfd->class_dev.class = &video_class; | 2187 | vfd->class_dev.class = &video_class; |
2191 | vfd->class_dev.devt = MKDEV(VIDEO_MAJOR, vfd->minor); | 2188 | vfd->class_dev.devt = MKDEV(VIDEO_MAJOR, vfd->minor); |
2189 | if (vfd->dev) | ||
2190 | vfd->class_dev.parent = vfd->dev; | ||
2192 | sprintf(vfd->class_dev.bus_id, "%s%d", name_base, i - base); | 2191 | sprintf(vfd->class_dev.bus_id, "%s%d", name_base, i - base); |
2193 | ret = device_register(&vfd->class_dev); | 2192 | ret = device_register(&vfd->class_dev); |
2194 | if (ret < 0) { | 2193 | if (ret < 0) { |
2195 | printk(KERN_ERR "%s: device_register failed\n", | 2194 | printk(KERN_ERR "%s: device_register failed\n", __func__); |
2196 | __func__); | ||
2197 | goto fail_minor; | 2195 | goto fail_minor; |
2198 | } | 2196 | } |
2199 | 2197 | ||