]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/ia64/sn/kernel/mca.c
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
[linux-2.6-omap-h63xx.git] / arch / ia64 / sn / kernel / mca.c
index 6546db6abdba4b7c93c60b6ff7d72a8f1a7c8363..868c9aa64fe2db7af71a78016ab637b9b0a18a12 100644 (file)
@@ -3,13 +3,14 @@
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  *
- * Copyright (c) 2000-2004 Silicon Graphics, Inc.  All Rights Reserved.
+ * Copyright (c) 2000-2006 Silicon Graphics, Inc.  All Rights Reserved.
  */
 
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/timer.h>
 #include <linux/vmalloc.h>
+#include <linux/mutex.h>
 #include <asm/mca.h>
 #include <asm/sal.h>
 #include <asm/sn/sn_sal.h>
@@ -27,7 +28,7 @@ void sn_init_cpei_timer(void);
 /* Printing oemdata from mca uses data that is not passed through SAL, it is
  * global.  Only one user at a time.
  */
-static DECLARE_MUTEX(sn_oemdata_mutex);
+static DEFINE_MUTEX(sn_oemdata_mutex);
 static u8 **sn_oemdata;
 static u64 *sn_oemdata_size, sn_oemdata_bufsize;
 
@@ -89,7 +90,7 @@ static int
 sn_platform_plat_specific_err_print(const u8 * sect_header, u8 ** oemdata,
                                    u64 * oemdata_size)
 {
-       down(&sn_oemdata_mutex);
+       mutex_lock(&sn_oemdata_mutex);
        sn_oemdata = oemdata;
        sn_oemdata_size = oemdata_size;
        sn_oemdata_bufsize = 0;
@@ -97,6 +98,7 @@ sn_platform_plat_specific_err_print(const u8 * sect_header, u8 ** oemdata,
        while (*sn_oemdata_size > sn_oemdata_bufsize) {
                u8 *newbuf = vmalloc(*sn_oemdata_size);
                if (!newbuf) {
+                       mutex_unlock(&sn_oemdata_mutex);
                        printk(KERN_ERR "%s: unable to extend sn_oemdata\n",
                               __FUNCTION__);
                        return 1;
@@ -107,7 +109,7 @@ sn_platform_plat_specific_err_print(const u8 * sect_header, u8 ** oemdata,
                *sn_oemdata_size = 0;
                ia64_sn_plat_specific_err_print(print_hook, (char *)sect_header);
        }
-       up(&sn_oemdata_mutex);
+       mutex_unlock(&sn_oemdata_mutex);
        return 0;
 }
 
@@ -136,7 +138,8 @@ int sn_salinfo_platform_oemdata(const u8 *sect_header, u8 **oemdata, u64 *oemdat
 
 static int __init sn_salinfo_init(void)
 {
-       salinfo_platform_oemdata = &sn_salinfo_platform_oemdata;
+       if (ia64_platform_is("sn2"))
+               salinfo_platform_oemdata = &sn_salinfo_platform_oemdata;
        return 0;
 }