提交 c3bff2ec 编写于 作者: P Pierre Ossman

mmc: get back read-only switch function

Somehow the code to read the read-only switch of SD cards got lost
in the reorganisation.
Signed-off-by: NPierre Ossman <drzeus@drzeus.cx>
上级 0107a4b3
...@@ -427,6 +427,21 @@ static int mmc_sd_init_card(struct mmc_host *host, u32 ocr, ...@@ -427,6 +427,21 @@ static int mmc_sd_init_card(struct mmc_host *host, u32 ocr,
mmc_set_bus_width(host, MMC_BUS_WIDTH_4); mmc_set_bus_width(host, MMC_BUS_WIDTH_4);
} }
/*
* Check if read-only switch is active.
*/
if (!oldcard) {
if (!host->ops->get_ro) {
printk(KERN_WARNING "%s: host does not "
"support reading read-only "
"switch. assuming write-enable.\n",
mmc_hostname(host));
} else {
if (host->ops->get_ro(host))
mmc_card_set_readonly(card);
}
}
if (!oldcard) if (!oldcard)
host->card = card; host->card = card;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册