Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b922f53b authored by Jens Axboe's avatar Jens Axboe
Browse files

x86-64: update nommu to sg helpers

parent 8b87d9f4
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -5,6 +5,7 @@
#include <linux/pci.h>
#include <linux/pci.h>
#include <linux/string.h>
#include <linux/string.h>
#include <linux/dma-mapping.h>
#include <linux/dma-mapping.h>
#include <linux/scatterlist.h>


#include <asm/iommu.h>
#include <asm/iommu.h>
#include <asm/processor.h>
#include <asm/processor.h>
@@ -57,10 +58,10 @@ static void nommu_unmap_single(struct device *dev, dma_addr_t addr,size_t size,
static int nommu_map_sg(struct device *hwdev, struct scatterlist *sg,
static int nommu_map_sg(struct device *hwdev, struct scatterlist *sg,
	       int nents, int direction)
	       int nents, int direction)
{
{
	struct scatterlist *s;
	int i;
	int i;


 	for (i = 0; i < nents; i++ ) {
	for_each_sg(sg, s, nents, i) {
		struct scatterlist *s = &sg[i];
		BUG_ON(!s->page);
		BUG_ON(!s->page);
		s->dma_address = virt_to_bus(page_address(s->page) +s->offset);
		s->dma_address = virt_to_bus(page_address(s->page) +s->offset);
		if (!check_addr("map_sg", hwdev, s->dma_address, s->length))
		if (!check_addr("map_sg", hwdev, s->dma_address, s->length))