]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
mtd: constify mtd_partition
authorArvind Yadav <arvind.yadav.cs@gmail.com>
Mon, 28 Aug 2017 08:24:57 +0000 (13:54 +0530)
committerRichard Weinberger <richard@nod.at>
Mon, 6 Nov 2017 22:26:01 +0000 (23:26 +0100)
mtd_partition are not supposed to change at runtime.
Functions 'mtd_device_parse_register' working with const mtd_partition
provided by <linux/mtd/mtd.h>. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
drivers/mtd/devices/lart.c
drivers/mtd/maps/cfi_flagadm.c
drivers/mtd/maps/impa7.c
drivers/mtd/maps/netsc520.c
drivers/mtd/maps/nettel.c
drivers/mtd/maps/sbc_gxx.c
drivers/mtd/maps/ts5500_flash.c
drivers/mtd/maps/uclinux.c
drivers/mtd/nand/ams-delta.c
drivers/mtd/nand/cmx270_nand.c

index 268aae45b5149de12ff77e59df776790724dede8..555b94406e0bb31a83c92fd03a70250cce015842 100644 (file)
@@ -583,7 +583,7 @@ static struct mtd_erase_region_info erase_regions[] = {
        }
 };
 
-static struct mtd_partition lart_partitions[] = {
+static const struct mtd_partition lart_partitions[] = {
        /* blob */
        {
                .name   = "blob",
index d504b3d1791da8ef70076d2b936c6afba7cc863c..70f488628464d41682b2392c5d677cdbbde55b92 100644 (file)
@@ -61,7 +61,7 @@ static struct map_info flagadm_map = {
                .bankwidth =    2,
 };
 
-static struct mtd_partition flagadm_parts[] = {
+static const struct mtd_partition flagadm_parts[] = {
        {
                .name =         "Bootloader",
                .offset =       FLASH_PARTITION0_ADDR,
index 15bbda03be6542cd860759a79a914387c842301d..a0b8fa7849a956c31250fd6946638f3423a9b58e 100644 (file)
@@ -47,7 +47,7 @@ static struct map_info impa7_map[NUM_FLASHBANKS] = {
 /*
  * MTD partitioning stuff
  */
-static struct mtd_partition partitions[] =
+static const struct mtd_partition partitions[] =
 {
        {
                .name = "FileSystem",
index 81dc2598bc0ac9085cadf7b332543e7752be5ade..3528497f96c779e8ce059471178bb771f895c216 100644 (file)
@@ -52,7 +52,7 @@
 /* partition_info gives details on the logical partitions that the split the
  * single flash device into. If the size if zero we use up to the end of the
  * device. */
-static struct mtd_partition partition_info[]={
+static const struct mtd_partition partition_info[] = {
     {
            .name = "NetSc520 boot kernel",
            .offset = 0,
index a577ef8553d076fb01a13b01de55fb5a672e9e77..729579fb654ffcaea4cc6afb698ff43ce337f7de 100644 (file)
@@ -107,7 +107,7 @@ static struct map_info nettel_amd_map = {
        .bankwidth = AMD_BUSWIDTH,
 };
 
-static struct mtd_partition nettel_amd_partitions[] = {
+static const struct mtd_partition nettel_amd_partitions[] = {
        {
                .name = "SnapGear BIOS config",
                .offset = 0x000e0000,
index 556a2dfe94c586e03b363f5c2056992346df72b1..4337d279ad83629d23a4c8890176fbc30a1f4509 100644 (file)
@@ -87,7 +87,7 @@ static DEFINE_SPINLOCK(sbc_gxx_spin);
 /* partition_info gives details on the logical partitions that the split the
  * single flash device into. If the size if zero we use up to the end of the
  * device. */
-static struct mtd_partition partition_info[]={
+static const struct mtd_partition partition_info[] = {
     { .name = "SBC-GXx flash boot partition",
       .offset = 0,
       .size =   BOOT_PARTITION_SIZE_KiB*1024 },
index 9969fedb1f13c2be53859df396823260bd1b9740..8f177e0acb8c1dbb350728eb5dda97a1168c1feb 100644 (file)
@@ -43,7 +43,7 @@ static struct map_info ts5500_map = {
        .phys = WINDOW_ADDR
 };
 
-static struct mtd_partition ts5500_partitions[] = {
+static const struct mtd_partition ts5500_partitions[] = {
        {
                .name = "Drive A",
                .offset = 0,
index 00a8190797ec1d4a445fd4bd46bfe03903699a15..aef030ca8601c709cc735a180b6c997f8b951f7c 100644 (file)
@@ -49,7 +49,7 @@ static struct mtd_info *uclinux_ram_mtdinfo;
 
 /****************************************************************************/
 
-static struct mtd_partition uclinux_romfs[] = {
+static const struct mtd_partition uclinux_romfs[] = {
        { .name = "ROMfs" }
 };
 
index dcec9cf4983f812833bc9082eee7dc383c913eff..d60ada45c549450758a1079d097b81f56271580d 100644 (file)
@@ -41,7 +41,7 @@ static struct mtd_info *ams_delta_mtd = NULL;
  * Define partitions for flash devices
  */
 
-static struct mtd_partition partition_info[] = {
+static const struct mtd_partition partition_info[] = {
        { .name         = "Kernel",
          .offset       = 0,
          .size         = 3 * SZ_1M + SZ_512K },
index 1fc435f994e1eca9738b6d28c1b5adb8deb367d5..b01c9804590e5d484675a71bc684e99b51929c41 100644 (file)
@@ -42,7 +42,7 @@ static void __iomem *cmx270_nand_io;
 /*
  * Define static partitions for flash device
  */
-static struct mtd_partition partition_info[] = {
+static const struct mtd_partition partition_info[] = {
        [0] = {
                .name   = "cmx270-0",
                .offset = 0,