Commit 26a6d240 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Brian Norris

mtd: make mtd_partition.name const

This allows to drop a few casts.
Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
parent da6fcf0e
...@@ -534,7 +534,7 @@ static struct mtd_part *allocate_partition(struct mtd_info *master, ...@@ -534,7 +534,7 @@ static struct mtd_part *allocate_partition(struct mtd_info *master,
return slave; return slave;
} }
int mtd_add_partition(struct mtd_info *master, char *name, int mtd_add_partition(struct mtd_info *master, const char *name,
long long offset, long long length) long long offset, long long length)
{ {
struct mtd_partition part; struct mtd_partition part;
......
...@@ -81,7 +81,7 @@ static int parse_ofpart_partitions(struct mtd_info *master, ...@@ -81,7 +81,7 @@ static int parse_ofpart_partitions(struct mtd_info *master,
partname = of_get_property(pp, "label", &len); partname = of_get_property(pp, "label", &len);
if (!partname) if (!partname)
partname = of_get_property(pp, "name", &len); partname = of_get_property(pp, "name", &len);
(*pparts)[i].name = (char *)partname; (*pparts)[i].name = partname;
if (of_get_property(pp, "read-only", &len)) if (of_get_property(pp, "read-only", &len))
(*pparts)[i].mask_flags |= MTD_WRITEABLE; (*pparts)[i].mask_flags |= MTD_WRITEABLE;
...@@ -152,7 +152,7 @@ static int parse_ofoldpart_partitions(struct mtd_info *master, ...@@ -152,7 +152,7 @@ static int parse_ofoldpart_partitions(struct mtd_info *master,
if (names && (plen > 0)) { if (names && (plen > 0)) {
int len = strlen(names) + 1; int len = strlen(names) + 1;
(*pparts)[i].name = (char *)names; (*pparts)[i].name = names;
plen -= len; plen -= len;
names += len; names += len;
} else { } else {
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
*/ */
struct mtd_partition { struct mtd_partition {
char *name; /* identifier string */ const char *name; /* identifier string */
uint64_t size; /* partition size */ uint64_t size; /* partition size */
uint64_t offset; /* offset within the master MTD space */ uint64_t offset; /* offset within the master MTD space */
uint32_t mask_flags; /* master MTD flags to mask out for this partition */ uint32_t mask_flags; /* master MTD flags to mask out for this partition */
...@@ -80,7 +80,7 @@ extern int register_mtd_parser(struct mtd_part_parser *parser); ...@@ -80,7 +80,7 @@ extern int register_mtd_parser(struct mtd_part_parser *parser);
extern int deregister_mtd_parser(struct mtd_part_parser *parser); extern int deregister_mtd_parser(struct mtd_part_parser *parser);
int mtd_is_partition(const struct mtd_info *mtd); int mtd_is_partition(const struct mtd_info *mtd);
int mtd_add_partition(struct mtd_info *master, char *name, int mtd_add_partition(struct mtd_info *master, const char *name,
long long offset, long long length); long long offset, long long length);
int mtd_del_partition(struct mtd_info *master, int partno); int mtd_del_partition(struct mtd_info *master, int partno);
uint64_t mtd_get_device_size(const struct mtd_info *mtd); uint64_t mtd_get_device_size(const struct mtd_info *mtd);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment