On Mon, Sep 17, 2012 at 01:21:27AM +0200, Marek Vasut wrote: > Implement empty serial_* functions for SPL without serial > support enabled. This is imperative to haave once serial > multi is enabled unconditionally. > > Signed-off-by: Marek Vasut <[email protected]> > Cc: Marek Vasut <[email protected]> > Cc: Tom Rini <[email protected]> > --- > common/serial.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/common/serial.c b/common/serial.c > index 631af65..cef4ba8 100644 > --- a/common/serial.c > +++ b/common/serial.c > @@ -27,6 +27,16 @@ > #include <post.h> > #include <linux/compiler.h> > > +/* Implement prototypes for SPL without serial support */ > +#if defined(CONFIG_SPL_BUILD) && !defined(CONFIG_SPL_SERIAL_SUPPORT) > +int serial_init(void) { return 0; } > +void serial_setbrg(void) {} > +int serial_getc(void) { return 0; } > +int serial_tstc(void) { return 0; } > +void serial_putc(const char c) {} > +void serial_puts(const char *s) {}
This isn't quite right. We need to allow for:
- No output SPL, strings collected (so #defined to do{} while (0))
- puts + printf SPL (CONFIG_SPL_SERIAL_SUPPORT +
CONFIG_SPL_LIBCOMMON_SUPPORT)
- puts only SPL (CONFIG_SPL_SERIAL_SUPPORT + #define puts
serial_puts/putc).
I'm not asking you to do that, but you will have to adapt to it once
Jose is done with it. What that means, off the top of my head, is we
can just drop this patch as in the first and last case serial.o will be
garbage-collected (or not built) and in the middle case, this will be
fully used.
--
Tom
signature.asc
Description: Digital signature
_______________________________________________ U-Boot mailing list [email protected] http://lists.denx.de/mailman/listinfo/u-boot

