diff options
author | Nathan Lynch <ntl@pobox.com> | 2006-12-06 19:50:45 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-12-08 01:10:22 -0500 |
commit | f2d6d2d8bb4e9bb4aef225c149e42cac3ac3d4d0 (patch) | |
tree | 7efba50f075c5b751c7f28379c2bbc53f48555e1 /arch/powerpc/kernel/rtas.c | |
parent | 9d9d868ecf93b35c3c5b0ea3d639dc85e423eb02 (diff) |
[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 <ntl@pobox.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/rtas.c')
-rw-r--r-- | arch/powerpc/kernel/rtas.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c index 952f4c2fc1eb..76b5d7ebdcc6 100644 --- a/arch/powerpc/kernel/rtas.c +++ b/arch/powerpc/kernel/rtas.c | |||
@@ -303,6 +303,12 @@ int rtas_token(const char *service) | |||
303 | } | 303 | } |
304 | EXPORT_SYMBOL(rtas_token); | 304 | EXPORT_SYMBOL(rtas_token); |
305 | 305 | ||
306 | int rtas_service_present(const char *service) | ||
307 | { | ||
308 | return rtas_token(service) != RTAS_UNKNOWN_SERVICE; | ||
309 | } | ||
310 | EXPORT_SYMBOL(rtas_service_present); | ||
311 | |||
306 | #ifdef CONFIG_RTAS_ERROR_LOGGING | 312 | #ifdef CONFIG_RTAS_ERROR_LOGGING |
307 | /* | 313 | /* |
308 | * Return the firmware-specified size of the error log buffer | 314 | * Return the firmware-specified size of the error log buffer |