[PATCH] ARM: OMAP: Modified omap_mux_init_signal() to take in const char *

Tim Nordell tim.nordell at logicpd.com
Thu Oct 21 15:10:58 EDT 2010

 On 10/21/10 13:50, Tim Nordell wrote:
> If one does the following line twice with the old code:
> omap_mux_init_signal("uart3_rts_sd.gpio_164", OMAP_PIN_INPUT);
> omap_mux_init_signal("uart3_rts_sd.gpio_164", OMAP_PIN_INPUT);
> the compiler optimizes the two const strings into one string
> internally in the compiler.  The old code would modify the string
> by inserting a NULL effectively making the second call become:
> omap_mux_init_signal("uart3_rts_sd", OMAP_PIN_INPUT);
> Since the code changes _all_ uart3_rts_sd signals over to this,
> it'll cause unknown behavior, as well as making it more
> difficult to track down the reason since the string
> "uart3_rts_sd" by itself may not actually exist in your
> normal mux initialization sequence.

Gah.  I just realized there was a patch in the linux-omap tree to do the
same thing.


It looks like by inspection that there could be a couple of things wrong
with that patch however.  Namely, on the comparison of muxname to
m0_entry, if they have the same string up to mode0_len, such as
"dss_data1" and "dss_data12" it'd match there prematurely as it'd stop
comparing.  Also, a minor display issue on the printk of the new muxname.

- Tim

More information about the linux-arm-kernel mailing list