[U-Boot] [PATCH V2 1/2] GPIO: Tegra2: add GPIO driver for Tegra2

Wolfgang Denk
2011-06-03T04:36:31Z

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

--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Violence in reality is quite different from theory.
-- Spock, "The Cloud Minders", stardate 5818.4