]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/mpic: Fix use of "flags" variable in mpic_alloc()
authorKyle Moffett <Kyle.D.Moffett@boeing.com>
Thu, 22 Dec 2011 10:19:09 +0000 (10:19 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Wed, 22 Feb 2012 23:49:58 +0000 (10:49 +1100)
commitba28dd6266d37b860f6c5f5938370a18fd45ebc3
tree8e4c90c6cb951801fa01db37ba278e4e1f4da17b
parent2400c8dc0d8a24a8c1b6e2c625ca9097f745f71e
powerpc/mpic: Fix use of "flags" variable in mpic_alloc()

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: Kyle Moffett <Kyle.D.Moffett@boeing.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/sysdev/mpic.c