]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/mmc/host/wbsd.c
mmc: fix platform driver hotplug/coldplug
[linux-2.6-omap-h63xx.git] / drivers / mmc / host / wbsd.c
index 80db11c05f2a6e91ab155d9036338448dad2f44f..be624a049c67d7b0fad8c27537c28f7178c1eaa6 100644 (file)
 #include <linux/pnp.h>
 #include <linux/highmem.h>
 #include <linux/mmc/host.h>
+#include <linux/scatterlist.h>
 
 #include <asm/io.h>
 #include <asm/dma.h>
-#include <asm/scatterlist.h>
 
 #include "wbsd.h"
 
@@ -269,7 +269,7 @@ static inline int wbsd_next_sg(struct wbsd_host *host)
 
 static inline char *wbsd_sg_to_buffer(struct wbsd_host *host)
 {
-       return page_address(host->cur_sg->page) + host->cur_sg->offset;
+       return sg_virt(host->cur_sg);
 }
 
 static inline void wbsd_sg_to_dma(struct wbsd_host *host, struct mmc_data *data)
@@ -283,7 +283,7 @@ static inline void wbsd_sg_to_dma(struct wbsd_host *host, struct mmc_data *data)
        len = data->sg_len;
 
        for (i = 0; i < len; i++) {
-               sgbuf = page_address(sg[i].page) + sg[i].offset;
+               sgbuf = sg_virt(&sg[i]);
                memcpy(dmabuf, sgbuf, sg[i].length);
                dmabuf += sg[i].length;
        }
@@ -300,7 +300,7 @@ static inline void wbsd_dma_to_sg(struct wbsd_host *host, struct mmc_data *data)
        len = data->sg_len;
 
        for (i = 0; i < len; i++) {
-               sgbuf = page_address(sg[i].page) + sg[i].offset;
+               sgbuf = sg_virt(&sg[i]);
                memcpy(sgbuf, dmabuf, sg[i].length);
                dmabuf += sg[i].length;
        }
@@ -1948,6 +1948,7 @@ static struct platform_driver wbsd_driver = {
        .resume         = wbsd_platform_resume,
        .driver         = {
                .name   = DRIVER_NAME,
+               .owner  = THIS_MODULE,
        },
 };