sd卡拔出时系统内部的一些小流程

http://blog.chinaunix.net/uid-20564848-id-73630.html

EXPORT_SYMBOL(mmc_detect_change);
mmc_detect_change
==>mmc_schedule_delayed_work(&host->detect, delay);
==>host->detect就是mmc_rescan
INIT_DELAYED_WORK(&host->detect, mmc_rescan);
==>mmc_rescan
==>host->bus_ops->detect(host);//就是mmc_sdio_detect
==>static const struct mmc_bus_ops mmc_sdio_ops.detect = mmc_sdio_detect;
==>mmc_sdio_detect //如果发现卡已经拔走,那么执行
==>mmc_sdio_remove(host);//删除/sys/目录下的文件,同时释放kmalloc到的内存.
==>mmc_detach_bus
==>mmc_bus_put
if ((host->bus_refs == 0) && host->bus_ops)
    __mmc_release_bus(host);
==>__mmc_release_bus
==>host->bus_ops = NULL;//这样mmc_rescan的时候,就可以执行对mmc口进行重新检卡操作了.

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值