Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1322810c14c4b5126e731db2e1764b2e957a9b19
Commit:     1322810c14c4b5126e731db2e1764b2e957a9b19
Parent:     848cfdc5c1cd2163ba0c9a6490d9adcb7a7c3518
Author:     Masakazu Mokuno <[EMAIL PROTECTED]>
AuthorDate: Sat Jun 16 07:18:48 2007 +1000
Committer:  Paul Mackerras <[EMAIL PROTECTED]>
CommitDate: Thu Jun 28 19:16:33 2007 +1000

    [POWERPC] PS3: Compare firmware version
    
    Add a utility routine ps3_compare_firmware_version() to compare system
    firmware versions.  Uses the existing ps3_get_firmware_version() routine.
    
    Signed-off-by: Masakazu Mokuno <[EMAIL PROTECTED]>
    Signed-off-by: Geoff Levand <[EMAIL PROTECTED]>
    Signed-off-by: Paul Mackerras <[EMAIL PROTECTED]>
---
 arch/powerpc/platforms/ps3/setup.c |   32 ++++++++++++++++++++------------
 include/asm-powerpc/ps3.h          |    3 ++-
 2 files changed, 22 insertions(+), 13 deletions(-)

diff --git a/arch/powerpc/platforms/ps3/setup.c 
b/arch/powerpc/platforms/ps3/setup.c
index 9353967..b79d62b 100644
--- a/arch/powerpc/platforms/ps3/setup.c
+++ b/arch/powerpc/platforms/ps3/setup.c
@@ -46,18 +46,26 @@
 static void smp_send_stop(void) {}
 #endif
 
-int ps3_get_firmware_version(union ps3_firmware_version *v)
+static union ps3_firmware_version ps3_firmware_version;
+
+void ps3_get_firmware_version(union ps3_firmware_version *v)
 {
-       int result = lv1_get_version_info(&v->raw);
+       *v = ps3_firmware_version;
+}
+EXPORT_SYMBOL_GPL(ps3_get_firmware_version);
 
-       if (result) {
-               v->raw = 0;
-               return -1;
-       }
+int ps3_compare_firmware_version(u16 major, u16 minor, u16 rev)
+{
+       union ps3_firmware_version x;
+
+       x.pad = 0;
+       x.major = major;
+       x.minor = minor;
+       x.rev = rev;
 
-       return result;
+       return (ps3_firmware_version.raw - x.raw);
 }
-EXPORT_SYMBOL_GPL(ps3_get_firmware_version);
+EXPORT_SYMBOL_GPL(ps3_compare_firmware_version);
 
 static void ps3_power_save(void)
 {
@@ -146,13 +154,13 @@ static int ps3_set_dabr(u64 dabr)
 
 static void __init ps3_setup_arch(void)
 {
-       union ps3_firmware_version v;
 
        DBG(" -> %s:%d\n", __func__, __LINE__);
 
-       ps3_get_firmware_version(&v);
-       printk(KERN_INFO "PS3 firmware version %u.%u.%u\n", v.major, v.minor,
-               v.rev);
+       lv1_get_version_info(&ps3_firmware_version.raw);
+       printk(KERN_INFO "PS3 firmware version %u.%u.%u\n",
+              ps3_firmware_version.major, ps3_firmware_version.minor,
+              ps3_firmware_version.rev);
 
        ps3_spu_set_platform();
        ps3_map_htab();
diff --git a/include/asm-powerpc/ps3.h b/include/asm-powerpc/ps3.h
index 1e04651..ac85d72 100644
--- a/include/asm-powerpc/ps3.h
+++ b/include/asm-powerpc/ps3.h
@@ -35,7 +35,8 @@ union ps3_firmware_version {
        };
 };
 
-int ps3_get_firmware_version(union ps3_firmware_version *v);
+void ps3_get_firmware_version(union ps3_firmware_version *v);
+int ps3_compare_firmware_version(u16 major, u16 minor, u16 rev);
 
 /* 'Other OS' area */
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to