Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 33015
b: refs/heads/master
c: 3117bee
h: refs/heads/master
i:
  33013: 76d1a70
  33011: baec34e
  33007: 1608e2e
v: v3
  • Loading branch information
Michael Krufky authored and Mauro Carvalho Chehab committed Jul 29, 2006
1 parent 9e23bf0 commit 5c0a922
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d9cd2d9b61898354f5dbabdc490dd6ef309ebbd4
refs/heads/master: 3117beec7e43f91ce156cacf033a712c7e22737d
8 changes: 2 additions & 6 deletions trunk/drivers/media/video/bt8xx/bttv-driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -3909,8 +3909,6 @@ static void bttv_unregister_video(struct bttv *btv)
/* register video4linux devices */
static int __devinit bttv_register_video(struct bttv *btv)
{
int ret;

if (no_overlay <= 0) {
bttv_video_template.type |= VID_TYPE_OVERLAY;
} else {
Expand All @@ -3925,10 +3923,8 @@ static int __devinit bttv_register_video(struct bttv *btv)
goto err;
printk(KERN_INFO "bttv%d: registered device video%d\n",
btv->c.nr,btv->video_dev->minor & 0x1f);
ret = video_device_create_file(btv->video_dev, &class_device_attr_card);
if (ret < 0)
printk(KERN_WARNING "bttv: video_device_create_file error: "
"%d\n", ret);

video_device_create_file(btv->video_dev, &class_device_attr_card);

/* vbi */
btv->vbi_dev = vdev_init(btv, &bttv_vbi_template, "vbi");
Expand Down
33 changes: 28 additions & 5 deletions trunk/drivers/media/video/pvrusb2/pvrusb2-sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,8 @@ static ssize_t debugcmd_store(struct class_device *,const char *,size_t count);
static void pvr2_sysfs_add_debugifc(struct pvr2_sysfs *sfp)
{
struct pvr2_sysfs_debugifc *dip;
int ret;

dip = kmalloc(sizeof(*dip),GFP_KERNEL);
if (!dip) return;
memset(dip,0,sizeof(*dip));
Expand All @@ -613,8 +615,14 @@ static void pvr2_sysfs_add_debugifc(struct pvr2_sysfs *sfp)
dip->attr_debuginfo.attr.mode = S_IRUGO;
dip->attr_debuginfo.show = debuginfo_show;
sfp->debugifc = dip;
class_device_create_file(sfp->class_dev,&dip->attr_debugcmd);
class_device_create_file(sfp->class_dev,&dip->attr_debuginfo);
ret = class_device_create_file(sfp->class_dev,&dip->attr_debugcmd);
if (ret < 0)
printk(KERN_WARNING "%s: class_device_create_file error: %d\n",
__FUNCTION__, ret);
ret = class_device_create_file(sfp->class_dev,&dip->attr_debuginfo);
if (ret < 0)
printk(KERN_WARNING "%s: class_device_create_file error: %d\n",
__FUNCTION__, ret);
}


Expand Down Expand Up @@ -709,6 +717,8 @@ static void class_dev_create(struct pvr2_sysfs *sfp,
{
struct usb_device *usb_dev;
struct class_device *class_dev;
int ret;

usb_dev = pvr2_hdw_get_dev(sfp->channel.hdw);
if (!usb_dev) return;
class_dev = kmalloc(sizeof(*class_dev),GFP_KERNEL);
Expand All @@ -733,20 +743,33 @@ static void class_dev_create(struct pvr2_sysfs *sfp,

sfp->class_dev = class_dev;
class_dev->class_data = sfp;
class_device_register(class_dev);
ret = class_device_register(class_dev);
if (ret) {
printk(KERN_ERR "%s: class_device_register failed\n",
__FUNCTION__);
kfree(class_dev);
return;
}

sfp->attr_v4l_minor_number.attr.owner = THIS_MODULE;
sfp->attr_v4l_minor_number.attr.name = "v4l_minor_number";
sfp->attr_v4l_minor_number.attr.mode = S_IRUGO;
sfp->attr_v4l_minor_number.show = v4l_minor_number_show;
sfp->attr_v4l_minor_number.store = NULL;
class_device_create_file(sfp->class_dev,&sfp->attr_v4l_minor_number);
ret = class_device_create_file(sfp->class_dev,&sfp->attr_v4l_minor_number);
if (ret < 0)
printk(KERN_WARNING "%s: class_device_create_file error: %d\n",
__FUNCTION__, ret);

sfp->attr_unit_number.attr.owner = THIS_MODULE;
sfp->attr_unit_number.attr.name = "unit_number";
sfp->attr_unit_number.attr.mode = S_IRUGO;
sfp->attr_unit_number.show = unit_number_show;
sfp->attr_unit_number.store = NULL;
class_device_create_file(sfp->class_dev,&sfp->attr_unit_number);
ret = class_device_create_file(sfp->class_dev,&sfp->attr_unit_number);
if (ret < 0)
printk(KERN_WARNING "%s: class_device_create_file error: %d\n",
__FUNCTION__, ret);

pvr2_sysfs_add_controls(sfp);
#ifdef CONFIG_VIDEO_PVRUSB2_DEBUGIFC
Expand Down
11 changes: 8 additions & 3 deletions trunk/drivers/media/video/videodev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1512,6 +1512,7 @@ int video_register_device(struct video_device *vfd, int type, int nr)
int i=0;
int base;
int end;
int ret;
char *name_base;

switch(type)
Expand Down Expand Up @@ -1571,9 +1572,13 @@ int video_register_device(struct video_device *vfd, int type, int nr)
vfd->class_dev.class = &video_class;
vfd->class_dev.devt = MKDEV(VIDEO_MAJOR, vfd->minor);
sprintf(vfd->class_dev.class_id, "%s%d", name_base, i - base);
class_device_register(&vfd->class_dev);
class_device_create_file(&vfd->class_dev,
&class_device_attr_name);
ret = class_device_register(&vfd->class_dev);
if (ret) {
printk(KERN_ERR "%s: class_device_register failed\n",
__FUNCTION__);
return ret;
}
video_device_create_file(vfd, &class_device_attr_name);

#if 1
/* needed until all drivers are fixed */
Expand Down
7 changes: 5 additions & 2 deletions trunk/include/media/v4l2-dev.h
Original file line number Diff line number Diff line change
Expand Up @@ -341,11 +341,14 @@ extern int video_usercopy(struct inode *inode, struct file *file,
extern struct video_device* video_devdata(struct file*);

#define to_video_device(cd) container_of(cd, struct video_device, class_dev)
static inline void
static inline int
video_device_create_file(struct video_device *vfd,
struct class_device_attribute *attr)
{
class_device_create_file(&vfd->class_dev, attr);
int ret = class_device_create_file(&vfd->class_dev, attr);
if (ret < 0)
printk(KERN_WARNING "%s error: %d\n", __FUNCTION__, ret);
return ret;
}
static inline void
video_device_remove_file(struct video_device *vfd,
Expand Down

0 comments on commit 5c0a922

Please sign in to comment.