On Tuesday 17 May 2011, zhangfei gao wrote: > >> The code handle several register difference are located at > >> arch/arm/mach-mmp/mmp2.c is for mmp2 > >> arch/arm/mach-mmp/pxa910.c is for pxa910 serious, > >> arch/arm/mach-mmp/mmp3.c is for mmp3 serious, considering there may > >> still registers changing. > >> > >> The board difference are directly put in board.c > >> For example ttc_dkb do not use wp pin, so get_ro is provided. > > > > embedding the code in these chip files stops code sharing. For example, > > mmp3 has same controller as mmp2. > > If register are totally same, they can share. > If there is minor difference with chip upgrading, they can put in > different file. When we talked about similar problems in drivers during the Linaro Developer Summit, the broad consensus was to move code from arch/arm into individual device drivers, and I think this should be done for this driver too. My recommendation here would be to have no callbacks in the platform data at all, but instead have the code for all variants in the sdhci-pxa driver itself. You can still have a structure to describe the differences using function pointers, but it's better if that is part of the driver itself. In the platform data, provide a way to identify the variant of the controller (e.g. using an enum) and point to the base addresses as required. 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