Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1225414
| Path | csiph.com!xmission!us.feeder.erje.net!feeder.erje.net!1.eu.feeder.erje.net!nntpspool01.opticnetworks.net!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Lee Duncan <lduncan@suse.com> |
| Newsgroups | linux.kernel |
| Subject | [PATCH 08/17] Update the mmc driver to use idr helper functions. |
| Date | Tue, 15 Sep 2015 18:50:03 +0200 |
| Message-ID | <q91AD-24K-33@gated-at.bofh.it> (permalink) |
| References | <q91AC-24K-5@gated-at.bofh.it> |
| X-Original-To | <linux-scsi@vger.kernel.org>, <linux-kernel@vger.kernel.org> |
| X-Amavis-Alert | BAD HEADER SECTION, Duplicate header field: "References" |
| X-Mailer | git-send-email 2.1.4 |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 49 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Hannes Reinecke <hare@suse.com>, Johannes Thumshirn <jthumshirn@suse.de>, Christoph Hellwig <hch@infradead.org>, Lee Duncan <lduncan@suse.com>, Ulf Hansson <ulf.hansson@linaro.org> |
| X-Original-Date | Tue, 15 Sep 2015 09:46:08 -0700 |
| X-Original-Message-ID | <5e015e43f03ba302ded85e71db48a8ed6fdc1ac6.1442263512.git.lduncan@suse.com> |
| X-Original-References | <cover.1442263512.git.lduncan@suse.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1225414 |
Show key headers only | View raw
Signed-off-by: Lee Duncan <lduncan@suse.com>
---
drivers/mmc/core/host.c | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
index 99a9c9011c50..5aa2330f074c 100644
--- a/drivers/mmc/core/host.c
+++ b/drivers/mmc/core/host.c
@@ -40,9 +40,8 @@ static DEFINE_SPINLOCK(mmc_host_lock);
static void mmc_host_classdev_release(struct device *dev)
{
struct mmc_host *host = cls_dev_to_mmc_host(dev);
- spin_lock(&mmc_host_lock);
- idr_remove(&mmc_host_idr, host->index);
- spin_unlock(&mmc_host_lock);
+
+ idr_put_index(&mmc_host_idr, &mmc_host_lock, host->index);
kfree(host);
}
@@ -559,17 +558,12 @@ struct mmc_host *mmc_alloc_host(int extra, struct device *dev)
/* scanning will be enabled when we're ready */
host->rescan_disable = 1;
- idr_preload(GFP_KERNEL);
- spin_lock(&mmc_host_lock);
- err = idr_alloc(&mmc_host_idr, host, 0, 0, GFP_NOWAIT);
- if (err >= 0)
- host->index = err;
- spin_unlock(&mmc_host_lock);
- idr_preload_end();
+ err = idr_get_index(&mmc_host_idr, &mmc_host_lock, host);
if (err < 0) {
kfree(host);
return NULL;
}
+ host->index = err;
dev_set_name(&host->class_dev, "mmc%d", host->index);
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH 08/17] Update the mmc driver to use idr helper functions. Lee Duncan <lduncan@suse.com> - 2015-09-15 18:50 +0200 Re: [PATCH 08/17] Update the mmc driver to use idr helper functions. Ulf Hansson <ulf.hansson@linaro.org> - 2015-09-16 08:50 +0200
csiph-web