Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 359355
b: refs/heads/master
c: 803d9e0
h: refs/heads/master
i:
  359353: 7dccf4c
  359351: 7f6d45c
v: v3
  • Loading branch information
Tejun Heo authored and Linus Torvalds committed Feb 28, 2013
1 parent 646b1a3 commit e7819f8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 57f2667cc7ebf69bd5fdb26f132228d331766ea8
refs/heads/master: 803d9e043dc31ea2d26442618f0eb020550f8e08
11 changes: 6 additions & 5 deletions trunk/drivers/mmc/core/host.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e7819f8

Please sign in to comment.