diff options
Diffstat (limited to 'drivers/mtd/devices/lart.c')
-rw-r--r-- | drivers/mtd/devices/lart.c | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/drivers/mtd/devices/lart.c b/drivers/mtd/devices/lart.c index 772a0ff89e0f..3a11ea628e58 100644 --- a/drivers/mtd/devices/lart.c +++ b/drivers/mtd/devices/lart.c | |||
@@ -34,9 +34,6 @@ | |||
34 | /* debugging */ | 34 | /* debugging */ |
35 | //#define LART_DEBUG | 35 | //#define LART_DEBUG |
36 | 36 | ||
37 | /* partition support */ | ||
38 | #define HAVE_PARTITIONS | ||
39 | |||
40 | #include <linux/kernel.h> | 37 | #include <linux/kernel.h> |
41 | #include <linux/module.h> | 38 | #include <linux/module.h> |
42 | #include <linux/types.h> | 39 | #include <linux/types.h> |
@@ -44,9 +41,7 @@ | |||
44 | #include <linux/errno.h> | 41 | #include <linux/errno.h> |
45 | #include <linux/string.h> | 42 | #include <linux/string.h> |
46 | #include <linux/mtd/mtd.h> | 43 | #include <linux/mtd/mtd.h> |
47 | #ifdef HAVE_PARTITIONS | ||
48 | #include <linux/mtd/partitions.h> | 44 | #include <linux/mtd/partitions.h> |
49 | #endif | ||
50 | 45 | ||
51 | #ifndef CONFIG_SA1100_LART | 46 | #ifndef CONFIG_SA1100_LART |
52 | #error This is for LART architecture only | 47 | #error This is for LART architecture only |
@@ -598,7 +593,6 @@ static struct mtd_erase_region_info erase_regions[] = { | |||
598 | } | 593 | } |
599 | }; | 594 | }; |
600 | 595 | ||
601 | #ifdef HAVE_PARTITIONS | ||
602 | static struct mtd_partition lart_partitions[] = { | 596 | static struct mtd_partition lart_partitions[] = { |
603 | /* blob */ | 597 | /* blob */ |
604 | { | 598 | { |
@@ -619,7 +613,7 @@ static struct mtd_partition lart_partitions[] = { | |||
619 | .size = INITRD_LEN, /* MTDPART_SIZ_FULL */ | 613 | .size = INITRD_LEN, /* MTDPART_SIZ_FULL */ |
620 | } | 614 | } |
621 | }; | 615 | }; |
622 | #endif | 616 | #define NUM_PARTITIONS ARRAY_SIZE(lart_partitions) |
623 | 617 | ||
624 | static int __init lart_flash_init (void) | 618 | static int __init lart_flash_init (void) |
625 | { | 619 | { |
@@ -668,7 +662,6 @@ static int __init lart_flash_init (void) | |||
668 | result,mtd.eraseregions[result].erasesize,mtd.eraseregions[result].erasesize / 1024, | 662 | result,mtd.eraseregions[result].erasesize,mtd.eraseregions[result].erasesize / 1024, |
669 | result,mtd.eraseregions[result].numblocks); | 663 | result,mtd.eraseregions[result].numblocks); |
670 | 664 | ||
671 | #ifdef HAVE_PARTITIONS | ||
672 | printk ("\npartitions = %d\n", ARRAY_SIZE(lart_partitions)); | 665 | printk ("\npartitions = %d\n", ARRAY_SIZE(lart_partitions)); |
673 | 666 | ||
674 | for (result = 0; result < ARRAY_SIZE(lart_partitions); result++) | 667 | for (result = 0; result < ARRAY_SIZE(lart_partitions); result++) |
@@ -681,25 +674,16 @@ static int __init lart_flash_init (void) | |||
681 | result,lart_partitions[result].offset, | 674 | result,lart_partitions[result].offset, |
682 | result,lart_partitions[result].size,lart_partitions[result].size / 1024); | 675 | result,lart_partitions[result].size,lart_partitions[result].size / 1024); |
683 | #endif | 676 | #endif |
684 | #endif | ||
685 | 677 | ||
686 | #ifndef HAVE_PARTITIONS | ||
687 | result = mtd_device_register(&mtd, NULL, 0); | ||
688 | #else | ||
689 | result = mtd_device_register(&mtd, lart_partitions, | 678 | result = mtd_device_register(&mtd, lart_partitions, |
690 | ARRAY_SIZE(lart_partitions)); | 679 | ARRAY_SIZE(lart_partitions)); |
691 | #endif | ||
692 | 680 | ||
693 | return (result); | 681 | return (result); |
694 | } | 682 | } |
695 | 683 | ||
696 | static void __exit lart_flash_exit (void) | 684 | static void __exit lart_flash_exit (void) |
697 | { | 685 | { |
698 | #ifndef HAVE_PARTITIONS | ||
699 | mtd_device_unregister(&mtd); | ||
700 | #else | ||
701 | mtd_device_unregister(&mtd); | 686 | mtd_device_unregister(&mtd); |
702 | #endif | ||
703 | } | 687 | } |
704 | 688 | ||
705 | module_init (lart_flash_init); | 689 | module_init (lart_flash_init); |