On Thu, May 19, 2011 at 9:04 AM, Arnd Bergmann <arnd@xxxxxxxx> wrote: > 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 > Hi, Arnd When we start to share sdhci-pxa, we find another sdhci-platfm occurs. While in Shawn's patch, driver self-register is recommended. If this is new trend, it maybe a better choice to use separate driver for each device based on updated sdhci-platfm.c by Shawn. Will update the sdhci-mmp2.c for mmp2 only based on Shawn's modification. Thanks -- 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