Skip to content

Commit

Permalink
[POWERPC] 4xx: Use machine_device_initcall() for warp_nand
Browse files Browse the repository at this point in the history
With a multiplatform kernel, once built we always have warp_setup_nand_flash()
called and NDFC probed, no matter what machine we actually run on. This
potentially can cause problems (such as kernel crash), since NDFC is probed at
a warp-predefined address.

Using machine_device_initcall() NAND devices are registered if we run on a warp only.

Signed-off-by: Valentine Barshak <vbarshak@ru.mvista.com>
Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
  • Loading branch information
Valentine Barshak authored and Josh Boyer committed Apr 5, 2008
1 parent 9d7030b commit d0c8df6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/powerpc/platforms/44x/warp-nand.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <linux/mtd/partitions.h>
#include <linux/mtd/nand.h>
#include <linux/mtd/ndfc.h>
#include <asm/machdep.h>

#ifdef CONFIG_MTD_NAND_NDFC

Expand Down Expand Up @@ -100,6 +101,6 @@ static int warp_setup_nand_flash(void)

return 0;
}
device_initcall(warp_setup_nand_flash);
machine_device_initcall(warp, warp_setup_nand_flash);

#endif

0 comments on commit d0c8df6

Please sign in to comment.