summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeert Uytterhoeven2009-08-24 00:54:32 +0200
committerBenjamin Herrenschmidt2009-08-27 05:25:46 +0200
commit7b6a09f3d6aedeaac923824af2a5df30300b56e9 (patch)
tree24e81f45b2dc8a3327de366126d69f5ed1239221
parentMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 (diff)
downloadkernel-qcow2-linux-7b6a09f3d6aedeaac923824af2a5df30300b56e9.tar.gz
kernel-qcow2-linux-7b6a09f3d6aedeaac923824af2a5df30300b56e9.tar.xz
kernel-qcow2-linux-7b6a09f3d6aedeaac923824af2a5df30300b56e9.zip
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>
-rw-r--r--arch/powerpc/platforms/ps3/time.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/ps3/time.c b/arch/powerpc/platforms/ps3/time.c
index b178a1e66c91..40b5cb433005 100644
--- a/arch/powerpc/platforms/ps3/time.c
+++ b/arch/powerpc/platforms/ps3/time.c
@@ -21,6 +21,7 @@
#include <linux/kernel.h>
#include <linux/platform_device.h>
+#include <asm/firmware.h>
#include <asm/rtc.h>
#include <asm/lv1call.h>
#include <asm/ps3.h>
@@ -84,6 +85,9 @@ static int __init ps3_rtc_init(void)
{
struct platform_device *pdev;
+ if (!firmware_has_feature(FW_FEATURE_PS3_LV1))
+ return -ENODEV;
+
pdev = platform_device_register_simple("rtc-ps3", -1, NULL, 0);
if (IS_ERR(pdev))
return PTR_ERR(pdev);