summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/bttv-gpio.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media/video/bttv-gpio.c')
-rw-r--r--linux/drivers/media/video/bttv-gpio.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/linux/drivers/media/video/bttv-gpio.c b/linux/drivers/media/video/bttv-gpio.c
index 3f2566675..1f1a66daf 100644
--- a/linux/drivers/media/video/bttv-gpio.c
+++ b/linux/drivers/media/video/bttv-gpio.c
@@ -1,5 +1,5 @@
/*
- $Id: bttv-gpio.c,v 1.4 2004/10/13 10:39:00 kraxel Exp $
+ $Id: bttv-gpio.c,v 1.5 2004/10/27 18:34:55 kraxel Exp $
bttv-gpio.c -- gpio sub drivers
@@ -63,6 +63,7 @@ static void release_sub_device(struct device *dev)
int bttv_sub_add_device(struct bttv_core *core, char *name)
{
struct bttv_sub_device *sub;
+ int err;
sub = kmalloc(sizeof(*sub),GFP_KERNEL);
if (NULL == sub)
@@ -76,9 +77,13 @@ int bttv_sub_add_device(struct bttv_core *core, char *name)
snprintf(sub->dev.bus_id,sizeof(sub->dev.bus_id),"%s%d",
name, core->nr);
+ err = device_register(&sub->dev);
+ if (0 != err) {
+ kfree(sub);
+ return err;
+ }
printk("bttv%d: add subdevice \"%s\"\n", core->nr, sub->dev.bus_id);
list_add_tail(&sub->list,&core->subs);
- device_register(&sub->dev);
return 0;
}