On Thursday 19 May 2011, zhangfei gao wrote: > To make sdhci-pxa easy to maintain, we still prefer put platform > specific difference under platform code. > > "Identify controller from platform data" looks to me is same as using #ifdef. > The method is used in our another driver before. I meant run-time code, not compile-time #ifdef. In the long run, we want to have a kernel that is able to work on many different systems, and that means the drivers should not impose hardcoded limitations. > More and more workaround comes when more and more platform need to > support, making the driver bigger and bigger and not easy to maintain. > Nobody remember what's the workaround purpose several years later. > So the result is we have to re-write the driver again to make it simple :( > > Currently, the ip is shared among mmp2, pxa910, pxa168 etc, pxa910 > maintainer does not care what workaround is used on pxa168. > When mmp3 wants to reuse the ip, it's easier to not care what's the > history at all. > > So we still prefer keep driver as simple as possible, while specific > platform self-maintain specific workaround , which is not aware to > other platform. There are a lot of different ways to do the same thing, but splitting out code into the subarchitecture is not a good one. Please have a look at how Shawn Guo has reworked the sdhci-pltfm drivers to have common part as a library and then multiple users of that. You can probably do the same with the different versions of the sdhci-pxa driver. Arnd -- 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