Merge branch 'master' of /home/davem/src/GIT/linux-2.6/
[pandora-kernel.git] / arch / powerpc / kernel / vio.c
index bc7b41e..8223717 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/types.h>
 #include <linux/device.h>
 #include <linux/init.h>
+#include <linux/slab.h>
 #include <linux/console.h>
 #include <linux/module.h>
 #include <linux/mm.h>
@@ -1054,6 +1055,8 @@ static struct iommu_table *vio_build_iommu_table(struct vio_dev *dev)
                return NULL;
 
        tbl = kmalloc(sizeof(*tbl), GFP_KERNEL);
+       if (tbl == NULL)
+               return NULL;
 
        of_parse_dma_window(dev->dev.archdata.of_node, dma_window,
                            &tbl->it_index, &offset, &size);
@@ -1233,7 +1236,7 @@ struct vio_dev *vio_register_device_node(struct device_node *of_node)
                vio_cmo_set_dma_ops(viodev);
        else
                viodev->dev.archdata.dma_ops = &dma_iommu_ops;
-       viodev->dev.archdata.dma_data = vio_build_iommu_table(viodev);
+       set_iommu_table_base(&viodev->dev, vio_build_iommu_table(viodev));
        set_dev_node(&viodev->dev, of_node_to_nid(of_node));
 
        /* init generic 'struct device' fields: */