aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2008-07-17 15:45:00 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-07-20 06:28:32 -0400
commit2bc93aa304f10bf94c377a487b09df75eaf88ab6 (patch)
tree705573cee5d10f0aac7b7c80b781cade4a6342aa
parente3bf20de33b016ac73424a5574177ed46c754be3 (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>
-rw-r--r--drivers/media/video/videodev.c22
-rw-r--r--include/media/v4l2-dev.h2
2 files changed, 11 insertions, 13 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
395static 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
395struct video_device *video_device_alloc(void) 401struct 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
423static 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
429static struct class video_class = { 429static 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
diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h
index 3c934142f7f9..33f379b1ecfe 100644
--- a/include/media/v4l2-dev.h
+++ b/include/media/v4l2-dev.h
@@ -375,7 +375,7 @@ video_device_create_file(struct video_device *vfd,
375{ 375{
376 int ret = device_create_file(&vfd->class_dev, attr); 376 int ret = device_create_file(&vfd->class_dev, attr);
377 if (ret < 0) 377 if (ret < 0)
378 printk(KERN_WARNING "%s error: %d\n", __FUNCTION__, ret); 378 printk(KERN_WARNING "%s error: %d\n", __func__, ret);
379 return ret; 379 return ret;
380} 380}
381static inline void 381static inline void