[POWERPC] QE: Make qe_get_firmware_info reentrant
authorIonut Nicu <ionut.nicu@freescale.com>
Fri, 7 Mar 2008 17:27:59 +0000 (19:27 +0200)
committerKumar Gala <galak@kernel.crashing.org>
Mon, 10 Mar 2008 18:07:27 +0000 (13:07 -0500)
The function was returning NULL the second time it was
called if the firmware was uploaded from the boot loader
or the first time it was called if the firmware was
uploaded from the kernel.

Signed-off-by: Ionut Nicu <ionut.nicu@freescale.com>
Acked-By: Timur Tabi <timur@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
arch/powerpc/sysdev/qe_lib/qe.c

index f963fbf21ef021bd85566dbf3e469375ab7621bc..cc81fd1141b031ffe476a12f033a7c925aff8f79 100644 (file)
@@ -609,7 +609,10 @@ struct qe_firmware_info *qe_get_firmware_info(void)
         * If we haven't checked yet, and a driver hasn't uploaded a firmware
         * yet, then check the device tree for information.
         */
-       if (initialized || qe_firmware_uploaded)
+       if (qe_firmware_uploaded)
+               return &qe_firmware_info;
+
+       if (initialized)
                return NULL;
 
        initialized = 1;