mmc: deprecate mmc bus topology

The classic MMC bus was defined as multi card bus
system, which is reflected in the design in the MMC
layer.

When SD showed up, the bus topology was abandoned
and a star topology (one card per host) was mandated.
MMC version 4 has followed this, officially deprecating
the bus topology.

As we do not have any known users of the bus
topology we can remove support for it. This will
simplify the code and rectify some incorrect
assumptions in the newer additions.

Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
This commit is contained in:
Pierre Ossman 2007-01-03 19:47:29 +01:00
parent b5af25bee2
commit b855885e3b
5 changed files with 438 additions and 593 deletions

View File

@ -226,8 +226,7 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
struct mmc_blk_request brq;
int ret = 1, sg_pos, data_size;
if (mmc_card_claim_host(card))
goto flush_queue;
mmc_claim_host(card->host);
do {
struct mmc_command cmd;
@ -357,7 +356,7 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
spin_unlock_irq(&md->lock);
} while (ret);
mmc_card_release_host(card);
mmc_release_host(card->host);
return 1;
@ -393,9 +392,7 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
spin_unlock_irq(&md->lock);
}
flush_queue:
mmc_card_release_host(card);
mmc_release_host(card->host);
spin_lock_irq(&md->lock);
while (ret) {
@ -526,12 +523,12 @@ mmc_blk_set_blksize(struct mmc_blk_data *md, struct mmc_card *card)
if (mmc_card_blockaddr(card))
return 0;
mmc_card_claim_host(card);
mmc_claim_host(card->host);
cmd.opcode = MMC_SET_BLOCKLEN;
cmd.arg = 1 << md->block_bits;
cmd.flags = MMC_RSP_R1 | MMC_CMD_AC;
err = mmc_wait_for_cmd(card->host, &cmd, 5);
mmc_card_release_host(card);
mmc_release_host(card->host);
if (err) {
printk(KERN_ERR "%s: unable to set block size to %d: %d\n",

File diff suppressed because it is too large Load Diff

View File

@ -61,7 +61,6 @@ struct mmc_host;
* MMC device
*/
struct mmc_card {
struct list_head node; /* node in hosts devices list */
struct mmc_host *host; /* the host this device belongs to */
struct device dev; /* the device */
unsigned int rca; /* relative card address of device */
@ -123,11 +122,4 @@ struct mmc_driver {
extern int mmc_register_driver(struct mmc_driver *);
extern void mmc_unregister_driver(struct mmc_driver *);
static inline int mmc_card_claim_host(struct mmc_card *card)
{
return __mmc_claim_host(card->host, card);
}
#define mmc_card_release_host(c) mmc_release_host((c)->host)
#endif

View File

@ -138,14 +138,12 @@ struct mmc_host {
#define MMC_MODE_MMC 0
#define MMC_MODE_SD 1
struct list_head cards; /* devices attached to this host */
struct mmc_card *card; /* device attached to this host */
wait_queue_head_t wq;
spinlock_t lock; /* claimed lock */
unsigned int claimed:1; /* host exclusively claimed */
struct mmc_card *card_selected; /* the selected MMC card */
struct delayed_work detect;
#ifdef CONFIG_MMC_DEBUG
unsigned int removed:1; /* host is being removed */

View File

@ -8,7 +8,6 @@
#ifndef MMC_H
#define MMC_H
#include <linux/list.h>
#include <linux/interrupt.h>
#include <linux/device.h>
@ -107,13 +106,7 @@ extern int mmc_wait_for_app_cmd(struct mmc_host *, unsigned int,
extern void mmc_set_data_timeout(struct mmc_data *, const struct mmc_card *, int);
extern int __mmc_claim_host(struct mmc_host *host, struct mmc_card *card);
static inline void mmc_claim_host(struct mmc_host *host)
{
__mmc_claim_host(host, (struct mmc_card *)-1);
}
extern void mmc_claim_host(struct mmc_host *host);
extern void mmc_release_host(struct mmc_host *host);
#endif