Wednesday, October 7, 2009

linux 2.4.24.1中的一個資料結構mmc_bus_ops

先做此字串的搜尋...
~/linux-2.6.24.1/include/$ grep -R mmc_bus_ops *
host.h: const struct mmc_bus_ops *bus_ops;      /* current bus driver */
$
~/linux-2.6.24.1/include/linux/mmc$ grep -R mmc_bus_ops *
host.h: const struct mmc_bus_ops *bus_ops;      /* current bus driver */
$
很明顯的,此資料結構mmc_bus_ops在include/linux/mmc中被使用到,但是整個include目錄卻沒搜尋到此定義...
後來
~/linux-2.6.24.1/drivers/mmc$ grep -R mmc_bus_ops *
core/core.c:void mmc_attach_bus(struct mmc_host *host, const struct mmc_bus_ops *ops)
core/core.h:struct mmc_bus_ops {
core/core.h:void mmc_attach_bus(struct mmc_host *host, const struct mmc_bus_ops *ops);
core/mmc.c:static const struct mmc_bus_ops mmc_ops = {
core/sd.c:static const struct mmc_bus_ops mmc_sd_ops = {
core/sdio.c:static const struct mmc_bus_ops mmc_sdio_ops = {
以上,卻發現有這定義
core/core.h:struct mmc_bus_ops {
我認為linux-2.6.24.1/include是包含了所有的資料結構,不該在引用include目錄之外的資料結構,或許struct mmc_bus_ops的定義移到include中而不是在driver/mmc中會更恰當。

最後...我檢視了最新的linux,2.6.32-rc3,還是沒有修正這問題,還是他們這樣寫有別的用意???有待查證/會許我對linux source結構編排的觀念有誤

No comments:

Post a Comment