Merge tag 'dma-mapping-5.15' of git://git.infradead.org/users/hch/dma-mapping
[linux-2.6-microblaze.git] / arch / powerpc / platforms / pseries / vio.c
index e00f372..feafcb5 100644 (file)
@@ -560,7 +560,8 @@ static int vio_dma_iommu_map_sg(struct device *dev, struct scatterlist *sglist,
        for_each_sg(sglist, sgl, nelems, count)
                alloc_size += roundup(sgl->length, IOMMU_PAGE_SIZE(tbl));
 
-       if (vio_cmo_alloc(viodev, alloc_size))
+       ret = vio_cmo_alloc(viodev, alloc_size);
+       if (ret)
                goto out_fail;
        ret = ppc_iommu_map_sg(dev, tbl, sglist, nelems, dma_get_mask(dev),
                        direction, attrs);
@@ -577,7 +578,7 @@ out_deallocate:
        vio_cmo_dealloc(viodev, alloc_size);
 out_fail:
        atomic_inc(&viodev->cmo.allocs_failed);
-       return 0;
+       return ret;
 }
 
 static void vio_dma_iommu_unmap_sg(struct device *dev,
@@ -1257,7 +1258,7 @@ static int vio_bus_probe(struct device *dev)
 }
 
 /* convert from struct device to struct vio_dev and pass to driver. */
-static int vio_bus_remove(struct device *dev)
+static void vio_bus_remove(struct device *dev)
 {
        struct vio_dev *viodev = to_vio_dev(dev);
        struct vio_driver *viodrv = to_vio_driver(dev->driver);
@@ -1276,7 +1277,6 @@ static int vio_bus_remove(struct device *dev)
                vio_cmo_bus_remove(viodev);
 
        put_device(devptr);
-       return 0;
 }
 
 static void vio_bus_shutdown(struct device *dev)