diff options
author | Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com> | 2009-08-23 18:54:32 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-08-26 23:25:46 -0400 |
commit | 7b6a09f3d6aedeaac923824af2a5df30300b56e9 (patch) | |
tree | 24e81f45b2dc8a3327de366126d69f5ed1239221 /arch | |
parent | f415c413f458837bd0c27086b79aca889f9435e4 (diff) |
powerpc/ps3: Add missing check for PS3 to rtc-ps3 platform device registration
On non-PS3, we get:
| kernel BUG at drivers/rtc/rtc-ps3.c:36!
because the rtc-ps3 platform device is registered unconditionally in a kernel
with builtin support for PS3.
Reported-by: Sachin Sant <sachinp@in.ibm.com>
Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Acked-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/platforms/ps3/time.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/ps3/time.c b/arch/powerpc/platforms/ps3/time.c index b178a1e66c9..40b5cb43300 100644 --- a/arch/powerpc/platforms/ps3/time.c +++ b/arch/powerpc/platforms/ps3/time.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/kernel.h> | 21 | #include <linux/kernel.h> |
22 | #include <linux/platform_device.h> | 22 | #include <linux/platform_device.h> |
23 | 23 | ||
24 | #include <asm/firmware.h> | ||
24 | #include <asm/rtc.h> | 25 | #include <asm/rtc.h> |
25 | #include <asm/lv1call.h> | 26 | #include <asm/lv1call.h> |
26 | #include <asm/ps3.h> | 27 | #include <asm/ps3.h> |
@@ -84,6 +85,9 @@ static int __init ps3_rtc_init(void) | |||
84 | { | 85 | { |
85 | struct platform_device *pdev; | 86 | struct platform_device *pdev; |
86 | 87 | ||
88 | if (!firmware_has_feature(FW_FEATURE_PS3_LV1)) | ||
89 | return -ENODEV; | ||
90 | |||
87 | pdev = platform_device_register_simple("rtc-ps3", -1, NULL, 0); | 91 | pdev = platform_device_register_simple("rtc-ps3", -1, NULL, 0); |
88 | if (IS_ERR(pdev)) | 92 | if (IS_ERR(pdev)) |
89 | return PTR_ERR(pdev); | 93 | return PTR_ERR(pdev); |