• Kyle Moffett's avatar
    powerpc/mpic: Fix use of "flags" variable in mpic_alloc() · 3a7a7176
    Kyle Moffett authored
    The mpic_alloc() function takes a "flags" parameter and assigns it into
    the mpic->flags variable fairly early on, but several later pieces of
    code detect various device-tree properties and save them into the
    "mpic->flags" variable (EG: "big-endian" => MPIC_BIG_ENDIAN).
    
    Unfortunately, a number of codepaths (including several which test the
    flag MPIC_BIG_ENDIAN!) test "flags" instead of "mpic->flags", and get
    wrong answers as a result.
    
    Consolidate the device-tree flag tests early in mpic_alloc() and change
    all of the checks after "mpic->flags" is init'ed to use "mpic->flags".
    
    [BenH: Fixed up use of mpic->node before it's initialized]
    Signed-off-by: default avatarKyle Moffett <Kyle.D.Moffett@boeing.com>
    Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
    3a7a7176
mpic.c 47.6 KB