]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/sh/superhyway/superhyway.c
[PATCH vfs-2.6 1/6] vfs: replace parent == dentry->d_parent by IS_ROOT()
[linux-2.6-omap-h63xx.git] / drivers / sh / superhyway / superhyway.c
index 94b22903119841369dcae3779c55eaeb36fce066..4d0282b821b519b3bd750cd5266ea9a02b78cd26 100644 (file)
@@ -56,11 +56,10 @@ int superhyway_add_device(unsigned long base, struct superhyway_device *sdev,
        struct superhyway_device *dev = sdev;
 
        if (!dev) {
-               dev = kmalloc(sizeof(struct superhyway_device), GFP_KERNEL);
+               dev = kzalloc(sizeof(struct superhyway_device), GFP_KERNEL);
                if (!dev)
                        return -ENOMEM;
 
-               memset(dev, 0, sizeof(struct superhyway_device));
        }
 
        dev->bus = bus;
@@ -108,16 +107,17 @@ int superhyway_add_devices(struct superhyway_bus *bus,
 static int __init superhyway_init(void)
 {
        struct superhyway_bus *bus;
-       int ret = 0;
+       int ret;
 
-       device_register(&superhyway_bus_device);
+       ret = device_register(&superhyway_bus_device);
+       if (unlikely(ret))
+               return ret;
 
        for (bus = superhyway_channels; bus->ops; bus++)
                ret |= superhyway_scan_bus(bus);
 
        return ret;
 }
-
 postcore_initcall(superhyway_init);
 
 static const struct superhyway_device_id *