
Dear Tom Warren,
In message BANLkTi=Z7Tb7s1ghjkieRz812EOyM8ttJA@mail.gmail.com you wrote:
Let me double-check. IIRC, one (cmd_gpio) didn't apply since it was from another SoC and didn't have the commands we use on Tegra, and the other (where the driver should go) ended with Mike saying "i'm not sure sweating the location of the driver is important", so I've left it with the other GPIO drivers.
What I'm referring to is the "lots of duplicated code" part.
Actually, if you do a kompare between cmd_gpio.c and tegra2_gpio.c, there's virtually no 'duplicated' code, just 2 different implementations of do_gpio, with different args and parsing of params, etc. I use info, port, input and output, and cmd_gpio uses input, set, clear and toggle. Since cmd_gpio.c isn't built, it's not duplicating any code in the U-Boot binary, space-wise. So there's no advantage to using it instead of my own driver's cmd parser.
There is duplication (at least function-wise) in the U-Boot source code base. This is to be avoided.
Best regards,
Wolfgang Denk