This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / drivers / media / video / bttv-gpio.c
index ef67442..585f67d 100644 (file)
@@ -1,6 +1,4 @@
 /*
-    $Id: bttv-gpio.c,v 1.6 2004/11/03 09:04:50 kraxel Exp $
-
     bttv-gpio.c  --  gpio sub drivers
 
     sysfs-based sub driver interface for bttv
@@ -24,7 +22,7 @@
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
+    
 */
 
 #include <linux/module.h>
@@ -63,7 +61,6 @@ 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)
@@ -77,13 +74,9 @@ 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;
 }
 
@@ -134,7 +127,8 @@ int bttv_sub_register(struct bttv_sub_driver *sub, char *wanted)
 {
        sub->drv.bus = &bttv_sub_bus_type;
        snprintf(sub->wanted,sizeof(sub->wanted),"%s",wanted);
-       return driver_register(&sub->drv);
+       driver_register(&sub->drv);
+       return 0;
 }
 EXPORT_SYMBOL(bttv_sub_register);