Skip to content

Commit

Permalink
powerpc/ps3: Add missing check for PS3 to rtc-ps3 platform device reg…
Browse files Browse the repository at this point in the history
…istration

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>
  • Loading branch information
Geert Uytterhoeven authored and Benjamin Herrenschmidt committed Aug 27, 2009
1 parent f415c41 commit 7b6a09f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arch/powerpc/platforms/ps3/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 7b6a09f

Please sign in to comment.