Message ID | 1443803813-13369-1-git-send-email-ben.dooks@codethink.co.uk (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c index abd933b..3bed4d0 100644 --- a/drivers/mmc/core/host.c +++ b/drivers/mmc/core/host.c @@ -561,7 +561,11 @@ struct mmc_host *mmc_alloc_host(int extra, struct device *dev) host->rescan_disable = 1; idr_preload(GFP_KERNEL); spin_lock(&mmc_host_lock); - err = idr_alloc(&mmc_host_idr, host, 0, 0, GFP_NOWAIT); + err = of_alias_get_id(dev->of_node, "mmc"); + if (err >= 0) + err = idr_alloc(&mmc_host_idr, host, err, err+1, GFP_NOWAIT); + if (err < 0) + err = idr_alloc(&mmc_host_idr, host, 0, 0, GFP_NOWAIT); if (err >= 0) host->index = err; spin_unlock(&mmc_host_lock);