• Geert Uytterhoeven's avatar
    pinctrl: sh-pfc: Add check for empty pinmux groups/functions · 3dd5fd79
    Geert Uytterhoeven authored
    The pinmux groups and functions arrays may contain two parts, to ease
    supporting SoCs that expose pin subsets of other related SoCs.  Both
    parts need to be declared with explicit sizes, which thus need to be
    updated when adding support for more groups and functions.
    
    If a size is too small, the compiler will detect this at build time
    ("excess elements in array initializer").
    If a size is too large, this may go undetected (for pin groups), lead to
    pin controller registration failures (for pin functions: "pinmux ops has
    no name for functionN"), or crash the optional run-time debug code (for
    pin groups).
    
    Extend the run-time debug code with checks to detect this, to help
    catching bugs early.
    Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
    Reviewed-by: default avatarSimon Horman <horms+renesas@verge.net.au>
    3dd5fd79
core.c 22 KB