Skip to content

Commit

Permalink
m68k/q40: Add missing platform check before registering platform devices
Browse files Browse the repository at this point in the history
On multi-platform kernels, the Q40/Q60 platform devices should be
registered when running on Q40/Q60 only. Else it may crash later.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
  • Loading branch information
Geert Uytterhoeven committed Apr 1, 2012
1 parent 6cfeba5 commit 450aed7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions arch/m68k/q40/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,9 @@ static __init int q40_add_kbd_device(void)
{
struct platform_device *pdev;

if (!MACH_IS_Q40)
return -ENODEV;

pdev = platform_device_register_simple("q40kbd", -1, NULL, 0);
if (IS_ERR(pdev))
return PTR_ERR(pdev);
Expand Down

0 comments on commit 450aed7

Please sign in to comment.