Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f2d6d2d8bb4e9bb4aef225c149e42cac3ac3d4d0
Commit:     f2d6d2d8bb4e9bb4aef225c149e42cac3ac3d4d0
Parent:     9d9d868ecf93b35c3c5b0ea3d639dc85e423eb02
Author:     Nathan Lynch <[EMAIL PROTECTED]>
AuthorDate: Wed Dec 6 18:50:45 2006 -0600
Committer:  Paul Mackerras <[EMAIL PROTECTED]>
CommitDate: Fri Dec 8 17:10:22 2006 +1100

    [POWERPC] Add rtas_service_present() helper
    
    To test for the existence of an RTAS function, we typically do:
    
       foo_token = rtas_token("foo");
       if (foo_token == RTAS_UNKNOWN_SERVICE)
          return;
    
    Add a rtas_service_present method, which provides a more conventional
    boolean interface for testing the existence of an RTAS method.
    
    Signed-off-by: Nathan Lynch <[EMAIL PROTECTED]>
    Signed-off-by: Paul Mackerras <[EMAIL PROTECTED]>
---
 arch/powerpc/kernel/rtas.c |    6 ++++++
 include/asm-powerpc/rtas.h |    1 +
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
index 952f4c2..76b5d7e 100644
--- a/arch/powerpc/kernel/rtas.c
+++ b/arch/powerpc/kernel/rtas.c
@@ -303,6 +303,12 @@ int rtas_token(const char *service)
 }
 EXPORT_SYMBOL(rtas_token);
 
+int rtas_service_present(const char *service)
+{
+       return rtas_token(service) != RTAS_UNKNOWN_SERVICE;
+}
+EXPORT_SYMBOL(rtas_service_present);
+
 #ifdef CONFIG_RTAS_ERROR_LOGGING
 /*
  * Return the firmware-specified size of the error log buffer
diff --git a/include/asm-powerpc/rtas.h b/include/asm-powerpc/rtas.h
index 031ef57..8eaa7b2 100644
--- a/include/asm-powerpc/rtas.h
+++ b/include/asm-powerpc/rtas.h
@@ -159,6 +159,7 @@ extern struct rtas_t rtas;
 
 extern void enter_rtas(unsigned long);
 extern int rtas_token(const char *service);
+extern int rtas_service_present(const char *service);
 extern int rtas_call(int token, int, int, int *, ...);
 extern void rtas_restart(char *cmd);
 extern void rtas_power_off(void);
-
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