On May 29, 2011, at 10:42 PM, zhangfei gao wrote: >> >> There is a little room for simplification, I think: >> >>> +static unsigned int mmp2_get_ro(struct sdhci_host *host) >>> +{ >>> + /* Micro SD does not support write-protect feature */ >>> + return 0; >>> +} >> >> You shouldn't need to provide an empty get_ro function, the >> default is that there is no write-protect. > > Thanks Arnd for review. > The reason to put get_ro here is some board use micro sd, while some > board design is general sd card. > The micro sd do not use write-protect, while SDHCI_WRITE_PROTECT will > return 1 in our controller, so it shows read only. > So add one call back for the board with micro sd card via flag. The code sets get_ro is for all the controllers. Some board designs may connect the WP signal. The host->ops field should be filled in using information in the board file using a flag such as the example with PXA_FLAG_CARD_PERMANENT. eg if (pdata && pdata->flags & PXA_FLAG_NO_WP) { ***** etc **** } -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html