aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/spi/spi.c')
-rw-r--r--drivers/spi/spi.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index ebcb33df2eb2..50f20f243981 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -615,13 +615,13 @@ static int spi_map_buf(struct spi_master *master, struct device *dev,
615 sg_free_table(sgt); 615 sg_free_table(sgt);
616 return -ENOMEM; 616 return -ENOMEM;
617 } 617 }
618 sg_buf = page_address(vm_page) + 618 sg_set_page(&sgt->sgl[i], vm_page,
619 ((size_t)buf & ~PAGE_MASK); 619 min, offset_in_page(buf));
620 } else { 620 } else {
621 sg_buf = buf; 621 sg_buf = buf;
622 sg_set_buf(&sgt->sgl[i], sg_buf, min);
622 } 623 }
623 624
624 sg_set_buf(&sgt->sgl[i], sg_buf, min);
625 625
626 buf += min; 626 buf += min;
627 len -= min; 627 len -= min;