diff options
author | Chris Ball <cjb@laptop.org> | 2013-03-19 13:07:13 -0400 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2013-03-19 13:07:13 -0400 |
commit | 2c06aeb25ca92b839399c4e2c956cffc95b41978 (patch) | |
tree | 3fb5007eac3adb9d4c973978c3b084fa077e926b /drivers/mmc | |
parent | 9665f7f234d095fc7c28c70df819a3f7b6a7b4e8 (diff) | |
parent | 908ab9368866e6edf0edebdd546adefd5f3128f9 (diff) |
Merge tag 'tegra-for-3.10-fixes-for-mmc' of git://git.kernel.org/pub/scm/linux/kernel/git/swarren/linux-tegra into mmc-next
ARM: tegra: DT-related fixes needed by the MMC tree
In order to convert the Tegra MMC driver to using mmc_of_parse(), some
bugs in the Tegra device-tree content need to be fixed first; it's
currently wrong but unused, and mmc_of_parse() causes that data to be
used for the first time.
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/core/host.c | 11 | ||||
-rw-r--r-- | drivers/mmc/host/dw_mmc.c | 4 |
2 files changed, 8 insertions, 7 deletions
diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c index 821cd8224137..2a3593d9f87d 100644 --- a/drivers/mmc/core/host.c +++ b/drivers/mmc/core/host.c @@ -429,19 +429,20 @@ struct mmc_host *mmc_alloc_host(int extra, struct device *dev) int err; struct mmc_host *host; - if (!idr_pre_get(&mmc_host_idr, GFP_KERNEL)) - return NULL; - host = kzalloc(sizeof(struct mmc_host) + extra, GFP_KERNEL); if (!host) return NULL; /* scanning will be enabled when we're ready */ host->rescan_disable = 1; + idr_preload(GFP_KERNEL); spin_lock(&mmc_host_lock); - err = idr_get_new(&mmc_host_idr, host, &host->index); + err = idr_alloc(&mmc_host_idr, host, 0, 0, GFP_NOWAIT); + if (err >= 0) + host->index = err; spin_unlock(&mmc_host_lock); - if (err) + idr_preload_end(); + if (err < 0) goto free; dev_set_name(&host->class_dev, "mmc%d", host->index); diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 60063ccb4c4b..98342213ed21 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -1453,7 +1453,7 @@ static void dw_mci_read_data_pio(struct dw_mci *host) if (!sg_miter_next(sg_miter)) goto done; - host->sg = sg_miter->__sg; + host->sg = sg_miter->piter.sg; buf = sg_miter->addr; remain = sg_miter->length; offset = 0; @@ -1508,7 +1508,7 @@ static void dw_mci_write_data_pio(struct dw_mci *host) if (!sg_miter_next(sg_miter)) goto done; - host->sg = sg_miter->__sg; + host->sg = sg_miter->piter.sg; buf = sg_miter->addr; remain = sg_miter->length; offset = 0; |