struct mmc_request      *mrq;
        struct mmc_command      *cmd;
        struct mmc_data         *data;
-       struct mmc_host         *mmc;
        struct device           *dev;
        unsigned char           id; /* 16xx chips have 2 MMC blocks */
        void                    *virt_base;
                resptype = 3;
                break;
        default:
-               dev_err(mmc_dev(host->mmc),
+               dev_err(mmc_dev(mmc_from_priv(host)),
                        "Invalid response type: %04x\n", mmc_resp_type(cmd));
                break;
        }
                                        data->sg->length);
                }
                host->data->bytes_xfered += data->sg->length;
-               dma_unmap_sg(mmc_dev(host->mmc), data->sg, host->sg_len,
-                            dma_data_dir);
+               dma_unmap_sg(mmc_dev(mmc_from_priv(host)), data->sg,
+                            host->sg_len, dma_data_dir);
        }
 
        host->data = NULL;
 
        if (!data->stop) {
                host->mrq = NULL;
-               mmc_request_done(host->mmc, data->mrq);
+               mmc_request_done(mmc_from_priv(host), data->mrq);
                return;
        }
 
 
        if (host->data == NULL || cmd->error) {
                host->mrq = NULL;
-               mmc_request_done(host->mmc, cmd->mrq);
+               mmc_request_done(mmc_from_priv(host), cmd->mrq);
        }
 }
 
                struct mmc_request *mrq = host->mrq;
                mrq->cmd->error = -ETIMEDOUT;
                host->mrq = NULL;
-               mmc_request_done(host->mmc, mrq);
+               mmc_request_done(mmc_from_priv(host), mrq);
        }
 
        if (end_command)
                u32 state = GOLDFISH_MMC_READ(host, MMC_STATE);
                pr_info("%s: Card detect now %d\n", __func__,
                        (state & MMC_STATE_INSERTED));
-               mmc_detect_change(host->mmc, 0);
+               mmc_detect_change(mmc_from_priv(host), 0);
        }
 
        if (!end_command && !end_transfer && !state_changed && !cmd_timeout) {
                status = GOLDFISH_MMC_READ(host, MMC_INT_STATUS);
-               dev_info(mmc_dev(host->mmc),"spurious irq 0x%04x\n", status);
+               dev_info(mmc_dev(mmc_from_priv(host)), "spurious irq 0x%04x\n",
+                        status);
                if (status != 0) {
                        GOLDFISH_MMC_WRITE(host, MMC_INT_STATUS, status);
                        GOLDFISH_MMC_WRITE(host, MMC_INT_ENABLE, 0);
 
        dma_data_dir = mmc_get_dma_dir(data);
 
-       host->sg_len = dma_map_sg(mmc_dev(host->mmc), data->sg,
+       host->sg_len = dma_map_sg(mmc_dev(mmc_from_priv(host)), data->sg,
                                  sg_len, dma_data_dir);
        host->dma_done = 0;
        host->dma_in_use = 1;
        }
 
        host = mmc_priv(mmc);
-       host->mmc = mmc;
 
        pr_err("mmc: Mapping %lX to %lX\n", (long)res->start, (long)res->end);
        host->reg_base = ioremap(res->start, resource_size(res));
 
        ret = device_create_file(&pdev->dev, &dev_attr_cover_switch);
        if (ret)
-               dev_warn(mmc_dev(host->mmc),
-                        "Unable to create sysfs attributes\n");
+               dev_warn(mmc_dev(mmc), "Unable to create sysfs attributes\n");
 
        GOLDFISH_MMC_WRITE(host, MMC_SET_BUFFER, host->phys_base);
        GOLDFISH_MMC_WRITE(host, MMC_INT_ENABLE,
 dma_alloc_failed:
        iounmap(host->reg_base);
 ioremap_failed:
-       mmc_free_host(host->mmc);
+       mmc_free_host(mmc);
 err_alloc_host_failed:
        return ret;
 }
 static int goldfish_mmc_remove(struct platform_device *pdev)
 {
        struct goldfish_mmc_host *host = platform_get_drvdata(pdev);
+       struct mmc_host *mmc = mmc_from_priv(host);
 
        BUG_ON(host == NULL);
 
-       mmc_remove_host(host->mmc);
+       mmc_remove_host(mmc);
        free_irq(host->irq, host);
        dma_free_coherent(&pdev->dev, BUFFER_SIZE, host->virt_base, host->phys_base);
        iounmap(host->reg_base);
-       mmc_free_host(host->mmc);
+       mmc_free_host(mmc);
        return 0;
 }