From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerry Van Baren Date: Wed, 16 Sep 2009 11:27:53 -0400 Subject: [U-Boot] [PATCH 1/7] fdt_support: Add multi-serial support for stdout fixup In-Reply-To: <20090916151704.GA15878@oksana.dev.rtsoft.ru> References: <20090819183715.GA779@oksana.dev.rtsoft.ru> <4AB0E122.4010502@ge.com> <20090916151704.GA15878@oksana.dev.rtsoft.ru> Message-ID: <4AB103F9.4010605@ge.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Anton Vorontsov wrote: > Thanks for review Jerry. > > On Wed, Sep 16, 2009 at 08:59:14AM -0400, Jerry Van Baren wrote: > [...] >> Below is a *HAND MODIFIED* (i.e. probably broken) edit of Anton's >> patch reflecting my thoughts. >> >> I'll leave it up to Anton and Kumar... I'm OK with Anton's original >> patch and you have my >> Acked-by: Gerald Van Baren >> or you can verify and adopt my proposed change (more work :-() and add a >> Signed-off-by: Gerald Van Baren >> to Anton's s-o-b. >> >> Thanks, >> gvb >> ------------------------------------------------------------------------ > [...] >> #ifdef CONFIG_OF_STDOUT_VIA_ALIAS >> + >> +#ifdef CONFIG_SERIAL_MULTI >> +static void fdt_fill_sername(char *sername, size_t maxlen) >> +{ >> + const char *outname = stdio_devices[stdout]->name; >> + >> + if (strcmp(outname, "serial") > 0) >> + strncpy(sername, outname, maxlen); > > (1) > >> + /* eserial? */ >> + if (strcmp(outname + 1, "serial") > 0) >> + strncpy(sername, outname + 1, maxlen); >> +} >> +#else >> +static inline void fdt_fill_sername(char *sername, size_t maxlen) >> +{ >> + sprintf(sername, "serial%d", CONFIG_CONS_INDEX - 1); > > This case is also needed with multiserial, since 'serial' is > what you get by default, and (1) doesn't account 'serial' name. Ahh, whups, missed that. > So, we can either leave the patch as, or duplicate some code > for multiserial case, or do this ugly thing (I quite dislike > #ifdef like this, i.e. inside the code flow): [snip] > Though, I'll do whatever you prefer. Lets use the original patch. Acked-by: Gerald Van Baren Thanks, gvb