Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 17b0429d authored by Pierre Ossman's avatar Pierre Ossman
Browse files

mmc: remove custom error codes



Convert the MMC layer to use standard error codes and not its own,
incompatible values.

Signed-off-by: default avatarPierre Ossman <drzeus@drzeus.cx>
parent b7e113dc
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -154,7 +154,7 @@ static u32 mmc_sd_num_wr_blocks(struct mmc_card *card)
	cmd.flags = MMC_RSP_R1 | MMC_CMD_AC;
	cmd.flags = MMC_RSP_R1 | MMC_CMD_AC;


	err = mmc_wait_for_cmd(card->host, &cmd, 0);
	err = mmc_wait_for_cmd(card->host, &cmd, 0);
	if ((err != MMC_ERR_NONE) || !(cmd.resp[0] & R1_APP_CMD))
	if (err || !(cmd.resp[0] & R1_APP_CMD))
		return (u32)-1;
		return (u32)-1;


	memset(&cmd, 0, sizeof(struct mmc_command));
	memset(&cmd, 0, sizeof(struct mmc_command));
@@ -192,7 +192,7 @@ static u32 mmc_sd_num_wr_blocks(struct mmc_card *card)


	mmc_wait_for_req(card->host, &mrq);
	mmc_wait_for_req(card->host, &mrq);


	if (cmd.error != MMC_ERR_NONE || data.error != MMC_ERR_NONE)
	if (cmd.error || data.error)
		return (u32)-1;
		return (u32)-1;


	blocks = ntohl(blocks);
	blocks = ntohl(blocks);
+2 −2
Original line number Original line Diff line number Diff line
@@ -598,7 +598,7 @@ void mmc_rescan(struct work_struct *work)
		mmc_send_if_cond(host, host->ocr_avail);
		mmc_send_if_cond(host, host->ocr_avail);


		err = mmc_send_app_op_cond(host, 0, &ocr);
		err = mmc_send_app_op_cond(host, 0, &ocr);
		if (err == MMC_ERR_NONE) {
		if (!err) {
			if (mmc_attach_sd(host, ocr))
			if (mmc_attach_sd(host, ocr))
				mmc_power_off(host);
				mmc_power_off(host);
		} else {
		} else {
@@ -607,7 +607,7 @@ void mmc_rescan(struct work_struct *work)
			 * searching for MMC cards.
			 * searching for MMC cards.
			 */
			 */
			err = mmc_send_op_cond(host, 0, &ocr);
			err = mmc_send_op_cond(host, 0, &ocr);
			if (err == MMC_ERR_NONE) {
			if (!err) {
				if (mmc_attach_mmc(host, ocr))
				if (mmc_attach_mmc(host, ocr))
					mmc_power_off(host);
					mmc_power_off(host);
			} else {
			} else {
+18 −18
Original line number Original line Diff line number Diff line
@@ -164,10 +164,10 @@ static int mmc_read_ext_csd(struct mmc_card *card)


	BUG_ON(!card);
	BUG_ON(!card);


	err = MMC_ERR_FAILED;
	err = -EIO;


	if (card->csd.mmca_vsn < CSD_SPEC_VER_4)
	if (card->csd.mmca_vsn < CSD_SPEC_VER_4)
		return MMC_ERR_NONE;
		return 0;


	/*
	/*
	 * As the ext_csd is so large and mostly unused, we don't store the
	 * As the ext_csd is so large and mostly unused, we don't store the
@@ -178,11 +178,11 @@ static int mmc_read_ext_csd(struct mmc_card *card)
		printk(KERN_ERR "%s: could not allocate a buffer to "
		printk(KERN_ERR "%s: could not allocate a buffer to "
			"receive the ext_csd. mmc v4 cards will be "
			"receive the ext_csd. mmc v4 cards will be "
			"treated as v3.\n", mmc_hostname(card->host));
			"treated as v3.\n", mmc_hostname(card->host));
		return MMC_ERR_FAILED;
		return -ENOMEM;
	}
	}


	err = mmc_send_ext_csd(card, ext_csd);
	err = mmc_send_ext_csd(card, ext_csd);
	if (err != MMC_ERR_NONE) {
	if (err) {
		/*
		/*
		 * High capacity cards should have this "magic" size
		 * High capacity cards should have this "magic" size
		 * stored in their CSD.
		 * stored in their CSD.
@@ -197,7 +197,7 @@ static int mmc_read_ext_csd(struct mmc_card *card)
				"EXT_CSD, performance might "
				"EXT_CSD, performance might "
				"suffer.\n",
				"suffer.\n",
				mmc_hostname(card->host));
				mmc_hostname(card->host));
			err = MMC_ERR_NONE;
			err = 0;
		}
		}
		goto out;
		goto out;
	}
	}
@@ -258,14 +258,14 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,


	/* The extra bit indicates that we support high capacity */
	/* The extra bit indicates that we support high capacity */
	err = mmc_send_op_cond(host, ocr | (1 << 30), NULL);
	err = mmc_send_op_cond(host, ocr | (1 << 30), NULL);
	if (err != MMC_ERR_NONE)
	if (err)
		goto err;
		goto err;


	/*
	/*
	 * Fetch CID from card.
	 * Fetch CID from card.
	 */
	 */
	err = mmc_all_send_cid(host, cid);
	err = mmc_all_send_cid(host, cid);
	if (err != MMC_ERR_NONE)
	if (err)
		goto err;
		goto err;


	if (oldcard) {
	if (oldcard) {
@@ -290,7 +290,7 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
	 * Set card RCA.
	 * Set card RCA.
	 */
	 */
	err = mmc_set_relative_addr(card);
	err = mmc_set_relative_addr(card);
	if (err != MMC_ERR_NONE)
	if (err)
		goto free_card;
		goto free_card;


	mmc_set_bus_mode(host, MMC_BUSMODE_PUSHPULL);
	mmc_set_bus_mode(host, MMC_BUSMODE_PUSHPULL);
@@ -300,7 +300,7 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
		 * Fetch CSD from card.
		 * Fetch CSD from card.
		 */
		 */
		err = mmc_send_csd(card, card->raw_csd);
		err = mmc_send_csd(card, card->raw_csd);
		if (err != MMC_ERR_NONE)
		if (err)
			goto free_card;
			goto free_card;


		err = mmc_decode_csd(card);
		err = mmc_decode_csd(card);
@@ -315,7 +315,7 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
	 * Select card, as all following commands rely on that.
	 * Select card, as all following commands rely on that.
	 */
	 */
	err = mmc_select_card(card);
	err = mmc_select_card(card);
	if (err != MMC_ERR_NONE)
	if (err)
		goto free_card;
		goto free_card;


	if (!oldcard) {
	if (!oldcard) {
@@ -323,7 +323,7 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
		 * Fetch and process extened CSD.
		 * Fetch and process extened CSD.
		 */
		 */
		err = mmc_read_ext_csd(card);
		err = mmc_read_ext_csd(card);
		if (err != MMC_ERR_NONE)
		if (err)
			goto free_card;
			goto free_card;
	}
	}


@@ -334,7 +334,7 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
		(host->caps & MMC_CAP_MMC_HIGHSPEED)) {
		(host->caps & MMC_CAP_MMC_HIGHSPEED)) {
		err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
		err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
			EXT_CSD_HS_TIMING, 1);
			EXT_CSD_HS_TIMING, 1);
		if (err != MMC_ERR_NONE)
		if (err)
			goto free_card;
			goto free_card;


		mmc_card_set_highspeed(card);
		mmc_card_set_highspeed(card);
@@ -363,7 +363,7 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
		(host->caps & MMC_CAP_4_BIT_DATA)) {
		(host->caps & MMC_CAP_4_BIT_DATA)) {
		err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
		err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
			EXT_CSD_BUS_WIDTH, EXT_CSD_BUS_WIDTH_4);
			EXT_CSD_BUS_WIDTH, EXT_CSD_BUS_WIDTH_4);
		if (err != MMC_ERR_NONE)
		if (err)
			goto free_card;
			goto free_card;


		mmc_set_bus_width(card->host, MMC_BUS_WIDTH_4);
		mmc_set_bus_width(card->host, MMC_BUS_WIDTH_4);
@@ -372,14 +372,14 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
	if (!oldcard)
	if (!oldcard)
		host->card = card;
		host->card = card;


	return MMC_ERR_NONE;
	return 0;


free_card:
free_card:
	if (!oldcard)
	if (!oldcard)
		mmc_remove_card(card);
		mmc_remove_card(card);
err:
err:


	return MMC_ERR_FAILED;
	return -EIO;
}
}


/*
/*
@@ -413,7 +413,7 @@ static void mmc_detect(struct mmc_host *host)


	mmc_release_host(host);
	mmc_release_host(host);


	if (err != MMC_ERR_NONE) {
	if (err) {
		mmc_remove(host);
		mmc_remove(host);


		mmc_claim_host(host);
		mmc_claim_host(host);
@@ -502,7 +502,7 @@ static void mmc_resume(struct mmc_host *host)
	err = mmc_init_card(host, host->ocr, host->card);
	err = mmc_init_card(host, host->ocr, host->card);
	mmc_release_host(host);
	mmc_release_host(host);


	if (err != MMC_ERR_NONE) {
	if (err) {
		mmc_remove(host);
		mmc_remove(host);


		mmc_claim_host(host);
		mmc_claim_host(host);
@@ -565,7 +565,7 @@ int mmc_attach_mmc(struct mmc_host *host, u32 ocr)
	 * Detect and init the card.
	 * Detect and init the card.
	 */
	 */
	err = mmc_init_card(host, host->ocr, NULL);
	err = mmc_init_card(host, host->ocr, NULL);
	if (err != MMC_ERR_NONE)
	if (err)
		goto err;
		goto err;


	mmc_release_host(host);
	mmc_release_host(host);
+17 −17
Original line number Original line Diff line number Diff line
@@ -40,10 +40,10 @@ static int _mmc_select_card(struct mmc_host *host, struct mmc_card *card)
	}
	}


	err = mmc_wait_for_cmd(host, &cmd, MMC_CMD_RETRIES);
	err = mmc_wait_for_cmd(host, &cmd, MMC_CMD_RETRIES);
	if (err != MMC_ERR_NONE)
	if (err)
		return err;
		return err;


	return MMC_ERR_NONE;
	return 0;
}
}


int mmc_select_card(struct mmc_card *card)
int mmc_select_card(struct mmc_card *card)
@@ -99,13 +99,13 @@ int mmc_send_op_cond(struct mmc_host *host, u32 ocr, u32 *rocr)


	for (i = 100; i; i--) {
	for (i = 100; i; i--) {
		err = mmc_wait_for_cmd(host, &cmd, 0);
		err = mmc_wait_for_cmd(host, &cmd, 0);
		if (err != MMC_ERR_NONE)
		if (err)
			break;
			break;


		if (cmd.resp[0] & MMC_CARD_BUSY || ocr == 0)
		if (cmd.resp[0] & MMC_CARD_BUSY || ocr == 0)
			break;
			break;


		err = MMC_ERR_TIMEOUT;
		err = -ETIMEDOUT;


		mmc_delay(10);
		mmc_delay(10);
	}
	}
@@ -131,12 +131,12 @@ int mmc_all_send_cid(struct mmc_host *host, u32 *cid)
	cmd.flags = MMC_RSP_R2 | MMC_CMD_BCR;
	cmd.flags = MMC_RSP_R2 | MMC_CMD_BCR;


	err = mmc_wait_for_cmd(host, &cmd, MMC_CMD_RETRIES);
	err = mmc_wait_for_cmd(host, &cmd, MMC_CMD_RETRIES);
	if (err != MMC_ERR_NONE)
	if (err)
		return err;
		return err;


	memcpy(cid, cmd.resp, sizeof(u32) * 4);
	memcpy(cid, cmd.resp, sizeof(u32) * 4);


	return MMC_ERR_NONE;
	return 0;
}
}


int mmc_set_relative_addr(struct mmc_card *card)
int mmc_set_relative_addr(struct mmc_card *card)
@@ -154,10 +154,10 @@ int mmc_set_relative_addr(struct mmc_card *card)
	cmd.flags = MMC_RSP_R1 | MMC_CMD_AC;
	cmd.flags = MMC_RSP_R1 | MMC_CMD_AC;


	err = mmc_wait_for_cmd(card->host, &cmd, MMC_CMD_RETRIES);
	err = mmc_wait_for_cmd(card->host, &cmd, MMC_CMD_RETRIES);
	if (err != MMC_ERR_NONE)
	if (err)
		return err;
		return err;


	return MMC_ERR_NONE;
	return 0;
}
}


int mmc_send_csd(struct mmc_card *card, u32 *csd)
int mmc_send_csd(struct mmc_card *card, u32 *csd)
@@ -176,12 +176,12 @@ int mmc_send_csd(struct mmc_card *card, u32 *csd)
	cmd.flags = MMC_RSP_R2 | MMC_CMD_AC;
	cmd.flags = MMC_RSP_R2 | MMC_CMD_AC;


	err = mmc_wait_for_cmd(card->host, &cmd, MMC_CMD_RETRIES);
	err = mmc_wait_for_cmd(card->host, &cmd, MMC_CMD_RETRIES);
	if (err != MMC_ERR_NONE)
	if (err)
		return err;
		return err;


	memcpy(csd, cmd.resp, sizeof(u32) * 4);
	memcpy(csd, cmd.resp, sizeof(u32) * 4);


	return MMC_ERR_NONE;
	return 0;
}
}


int mmc_send_ext_csd(struct mmc_card *card, u8 *ext_csd)
int mmc_send_ext_csd(struct mmc_card *card, u8 *ext_csd)
@@ -218,12 +218,12 @@ int mmc_send_ext_csd(struct mmc_card *card, u8 *ext_csd)


	mmc_wait_for_req(card->host, &mrq);
	mmc_wait_for_req(card->host, &mrq);


	if (cmd.error != MMC_ERR_NONE)
	if (cmd.error)
		return cmd.error;
		return cmd.error;
	if (data.error != MMC_ERR_NONE)
	if (data.error)
		return data.error;
		return data.error;


	return MMC_ERR_NONE;
	return 0;
}
}


int mmc_switch(struct mmc_card *card, u8 set, u8 index, u8 value)
int mmc_switch(struct mmc_card *card, u8 set, u8 index, u8 value)
@@ -244,10 +244,10 @@ int mmc_switch(struct mmc_card *card, u8 set, u8 index, u8 value)
	cmd.flags = MMC_RSP_R1B | MMC_CMD_AC;
	cmd.flags = MMC_RSP_R1B | MMC_CMD_AC;


	err = mmc_wait_for_cmd(card->host, &cmd, MMC_CMD_RETRIES);
	err = mmc_wait_for_cmd(card->host, &cmd, MMC_CMD_RETRIES);
	if (err != MMC_ERR_NONE)
	if (err)
		return err;
		return err;


	return MMC_ERR_NONE;
	return 0;
}
}


int mmc_send_status(struct mmc_card *card, u32 *status)
int mmc_send_status(struct mmc_card *card, u32 *status)
@@ -265,12 +265,12 @@ int mmc_send_status(struct mmc_card *card, u32 *status)
	cmd.flags = MMC_RSP_R1 | MMC_CMD_AC;
	cmd.flags = MMC_RSP_R1 | MMC_CMD_AC;


	err = mmc_wait_for_cmd(card->host, &cmd, MMC_CMD_RETRIES);
	err = mmc_wait_for_cmd(card->host, &cmd, MMC_CMD_RETRIES);
	if (err != MMC_ERR_NONE)
	if (err)
		return err;
		return err;


	if (status)
	if (status)
		*status = cmd.resp[0];
		*status = cmd.resp[0];


	return MMC_ERR_NONE;
	return 0;
}
}
+28 −28
Original line number Original line Diff line number Diff line
@@ -193,30 +193,30 @@ static int mmc_read_switch(struct mmc_card *card)
	u8 *status;
	u8 *status;


	if (card->scr.sda_vsn < SCR_SPEC_VER_1)
	if (card->scr.sda_vsn < SCR_SPEC_VER_1)
		return MMC_ERR_NONE;
		return 0;


	if (!(card->csd.cmdclass & CCC_SWITCH)) {
	if (!(card->csd.cmdclass & CCC_SWITCH)) {
		printk(KERN_WARNING "%s: card lacks mandatory switch "
		printk(KERN_WARNING "%s: card lacks mandatory switch "
			"function, performance might suffer.\n",
			"function, performance might suffer.\n",
			mmc_hostname(card->host));
			mmc_hostname(card->host));
		return MMC_ERR_NONE;
		return 0;
	}
	}


	err = MMC_ERR_FAILED;
	err = -EIO;


	status = kmalloc(64, GFP_KERNEL);
	status = kmalloc(64, GFP_KERNEL);
	if (!status) {
	if (!status) {
		printk(KERN_ERR "%s: could not allocate a buffer for "
		printk(KERN_ERR "%s: could not allocate a buffer for "
			"switch capabilities.\n", mmc_hostname(card->host));
			"switch capabilities.\n", mmc_hostname(card->host));
		return err;
		return -ENOMEM;
	}
	}


	err = mmc_sd_switch(card, 0, 0, 1, status);
	err = mmc_sd_switch(card, 0, 0, 1, status);
	if (err != MMC_ERR_NONE) {
	if (err) {
		printk(KERN_WARNING "%s: problem reading switch "
		printk(KERN_WARNING "%s: problem reading switch "
			"capabilities, performance might suffer.\n",
			"capabilities, performance might suffer.\n",
			mmc_hostname(card->host));
			mmc_hostname(card->host));
		err = MMC_ERR_NONE;
		err = 0;
		goto out;
		goto out;
	}
	}


@@ -238,28 +238,28 @@ static int mmc_switch_hs(struct mmc_card *card)
	u8 *status;
	u8 *status;


	if (card->scr.sda_vsn < SCR_SPEC_VER_1)
	if (card->scr.sda_vsn < SCR_SPEC_VER_1)
		return MMC_ERR_NONE;
		return 0;


	if (!(card->csd.cmdclass & CCC_SWITCH))
	if (!(card->csd.cmdclass & CCC_SWITCH))
		return MMC_ERR_NONE;
		return 0;


	if (!(card->host->caps & MMC_CAP_SD_HIGHSPEED))
	if (!(card->host->caps & MMC_CAP_SD_HIGHSPEED))
		return MMC_ERR_NONE;
		return 0;


	if (card->sw_caps.hs_max_dtr == 0)
	if (card->sw_caps.hs_max_dtr == 0)
		return MMC_ERR_NONE;
		return 0;


	err = MMC_ERR_FAILED;
	err = -EIO;


	status = kmalloc(64, GFP_KERNEL);
	status = kmalloc(64, GFP_KERNEL);
	if (!status) {
	if (!status) {
		printk(KERN_ERR "%s: could not allocate a buffer for "
		printk(KERN_ERR "%s: could not allocate a buffer for "
			"switch capabilities.\n", mmc_hostname(card->host));
			"switch capabilities.\n", mmc_hostname(card->host));
		return err;
		return -ENOMEM;
	}
	}


	err = mmc_sd_switch(card, 1, 0, 1, status);
	err = mmc_sd_switch(card, 1, 0, 1, status);
	if (err != MMC_ERR_NONE)
	if (err)
		goto out;
		goto out;


	if ((status[16] & 0xF) != 1) {
	if ((status[16] & 0xF) != 1) {
@@ -309,18 +309,18 @@ static int mmc_sd_init_card(struct mmc_host *host, u32 ocr,
	 * block-addressed SDHC cards.
	 * block-addressed SDHC cards.
	 */
	 */
	err = mmc_send_if_cond(host, ocr);
	err = mmc_send_if_cond(host, ocr);
	if (err == MMC_ERR_NONE)
	if (!err)
		ocr |= 1 << 30;
		ocr |= 1 << 30;


	err = mmc_send_app_op_cond(host, ocr, NULL);
	err = mmc_send_app_op_cond(host, ocr, NULL);
	if (err != MMC_ERR_NONE)
	if (err)
		goto err;
		goto err;


	/*
	/*
	 * Fetch CID from card.
	 * Fetch CID from card.
	 */
	 */
	err = mmc_all_send_cid(host, cid);
	err = mmc_all_send_cid(host, cid);
	if (err != MMC_ERR_NONE)
	if (err)
		goto err;
		goto err;


	if (oldcard) {
	if (oldcard) {
@@ -344,7 +344,7 @@ static int mmc_sd_init_card(struct mmc_host *host, u32 ocr,
	 * Set card RCA.
	 * Set card RCA.
	 */
	 */
	err = mmc_send_relative_addr(host, &card->rca);
	err = mmc_send_relative_addr(host, &card->rca);
	if (err != MMC_ERR_NONE)
	if (err)
		goto free_card;
		goto free_card;


	mmc_set_bus_mode(host, MMC_BUSMODE_PUSHPULL);
	mmc_set_bus_mode(host, MMC_BUSMODE_PUSHPULL);
@@ -354,7 +354,7 @@ static int mmc_sd_init_card(struct mmc_host *host, u32 ocr,
		 * Fetch CSD from card.
		 * Fetch CSD from card.
		 */
		 */
		err = mmc_send_csd(card, card->raw_csd);
		err = mmc_send_csd(card, card->raw_csd);
		if (err != MMC_ERR_NONE)
		if (err)
			goto free_card;
			goto free_card;


		err = mmc_decode_csd(card);
		err = mmc_decode_csd(card);
@@ -368,7 +368,7 @@ static int mmc_sd_init_card(struct mmc_host *host, u32 ocr,
	 * Select card, as all following commands rely on that.
	 * Select card, as all following commands rely on that.
	 */
	 */
	err = mmc_select_card(card);
	err = mmc_select_card(card);
	if (err != MMC_ERR_NONE)
	if (err)
		goto free_card;
		goto free_card;


	if (!oldcard) {
	if (!oldcard) {
@@ -376,7 +376,7 @@ static int mmc_sd_init_card(struct mmc_host *host, u32 ocr,
		 * Fetch SCR from card.
		 * Fetch SCR from card.
		 */
		 */
		err = mmc_app_send_scr(card, card->raw_scr);
		err = mmc_app_send_scr(card, card->raw_scr);
		if (err != MMC_ERR_NONE)
		if (err)
			goto free_card;
			goto free_card;


		err = mmc_decode_scr(card);
		err = mmc_decode_scr(card);
@@ -387,7 +387,7 @@ static int mmc_sd_init_card(struct mmc_host *host, u32 ocr,
		 * Fetch switch information from card.
		 * Fetch switch information from card.
		 */
		 */
		err = mmc_read_switch(card);
		err = mmc_read_switch(card);
		if (err != MMC_ERR_NONE)
		if (err)
			goto free_card;
			goto free_card;
	}
	}


@@ -395,7 +395,7 @@ static int mmc_sd_init_card(struct mmc_host *host, u32 ocr,
	 * Attempt to change to high-speed (if supported)
	 * Attempt to change to high-speed (if supported)
	 */
	 */
	err = mmc_switch_hs(card);
	err = mmc_switch_hs(card);
	if (err != MMC_ERR_NONE)
	if (err)
		goto free_card;
		goto free_card;


	/*
	/*
@@ -418,7 +418,7 @@ static int mmc_sd_init_card(struct mmc_host *host, u32 ocr,
	if ((host->caps & MMC_CAP_4_BIT_DATA) &&
	if ((host->caps & MMC_CAP_4_BIT_DATA) &&
		(card->scr.bus_widths & SD_SCR_BUS_WIDTH_4)) {
		(card->scr.bus_widths & SD_SCR_BUS_WIDTH_4)) {
		err = mmc_app_set_bus_width(card, MMC_BUS_WIDTH_4);
		err = mmc_app_set_bus_width(card, MMC_BUS_WIDTH_4);
		if (err != MMC_ERR_NONE)
		if (err)
			goto free_card;
			goto free_card;


		mmc_set_bus_width(host, MMC_BUS_WIDTH_4);
		mmc_set_bus_width(host, MMC_BUS_WIDTH_4);
@@ -442,14 +442,14 @@ static int mmc_sd_init_card(struct mmc_host *host, u32 ocr,
	if (!oldcard)
	if (!oldcard)
		host->card = card;
		host->card = card;


	return MMC_ERR_NONE;
	return 0;


free_card:
free_card:
	if (!oldcard)
	if (!oldcard)
		mmc_remove_card(card);
		mmc_remove_card(card);
err:
err:


	return MMC_ERR_FAILED;
	return -EIO;
}
}


/*
/*
@@ -483,7 +483,7 @@ static void mmc_sd_detect(struct mmc_host *host)


	mmc_release_host(host);
	mmc_release_host(host);


	if (err != MMC_ERR_NONE) {
	if (err) {
		mmc_sd_remove(host);
		mmc_sd_remove(host);


		mmc_claim_host(host);
		mmc_claim_host(host);
@@ -574,7 +574,7 @@ static void mmc_sd_resume(struct mmc_host *host)
	err = mmc_sd_init_card(host, host->ocr, host->card);
	err = mmc_sd_init_card(host, host->ocr, host->card);
	mmc_release_host(host);
	mmc_release_host(host);


	if (err != MMC_ERR_NONE) {
	if (err) {
		mmc_sd_remove(host);
		mmc_sd_remove(host);


		mmc_claim_host(host);
		mmc_claim_host(host);
@@ -644,7 +644,7 @@ int mmc_attach_sd(struct mmc_host *host, u32 ocr)
	 * Detect and init the card.
	 * Detect and init the card.
	 */
	 */
	err = mmc_sd_init_card(host, host->ocr, NULL);
	err = mmc_sd_init_card(host, host->ocr, NULL);
	if (err != MMC_ERR_NONE)
	if (err)
		goto err;
		goto err;


	mmc_release_host(host);
	mmc_release_host(host);
Loading