]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/macintosh/macio_asic.c
block: sanitize invalid partition table entries
[linux-2.6-omap-h63xx.git] / drivers / macintosh / macio_asic.c
index e851266a2db1b37fa400c1143ee4ccea72789c3f..ec9e5f32f0ae3d3cf9c2ecc1cc34ce35d8a183d9 100644 (file)
@@ -365,10 +365,9 @@ static struct macio_dev * macio_add_one_device(struct macio_chip *chip,
        if (np == NULL)
                return NULL;
 
-       dev = kmalloc(sizeof(*dev), GFP_KERNEL);
+       dev = kzalloc(sizeof(*dev), GFP_KERNEL);
        if (!dev)
                return NULL;
-       memset(dev, 0, sizeof(*dev));
 
        dev->bus = &chip->lbus;
        dev->media_bay = in_bay;
@@ -395,7 +394,7 @@ static struct macio_dev * macio_add_one_device(struct macio_chip *chip,
 #endif
                        MAX_NODE_NAME_SIZE, np->name);
        } else {
-               reg = get_property(np, "reg", NULL);
+               reg = of_get_property(np, "reg", NULL);
                sprintf(dev->ofdev.dev.bus_id, "%1d.%08x:%.*s",
                        chip->lbus.index,
                        reg ? *reg : 0, MAX_NODE_NAME_SIZE, np->name);