Skip to content

Commit

Permalink
mtd: maps: add const qualifiers
Browse files Browse the repository at this point in the history
Be a bit stricter and add few more 'const' qualifiers.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
Artem Bityutskiy authored and David Woodhouse committed Apr 5, 2013
1 parent cce2a02 commit 0984c89
Show file tree
Hide file tree
Showing 13 changed files with 21 additions and 25 deletions.
3 changes: 2 additions & 1 deletion drivers/mtd/maps/bfin-async-flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ static void bfin_flash_copy_to(struct map_info *map, unsigned long to, const voi
switch_back(state);
}

static const char *part_probe_types[] = { "cmdlinepart", "RedBoot", NULL };
static const char * const part_probe_types[] = {
"cmdlinepart", "RedBoot", NULL };

static int bfin_flash_probe(struct platform_device *pdev)
{
Expand Down
3 changes: 1 addition & 2 deletions drivers/mtd/maps/dc21285.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,8 @@ static struct map_info dc21285_map = {
.copy_from = dc21285_copy_from,
};


/* Partition stuff */
static const char *probes[] = { "RedBoot", "cmdlinepart", NULL };
static const char * const probes[] = { "RedBoot", "cmdlinepart", NULL };

static int __init init_dc21285(void)
{
Expand Down
3 changes: 2 additions & 1 deletion drivers/mtd/maps/gpio-addr-flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ static void gf_copy_to(struct map_info *map, unsigned long to,
memcpy_toio(map->virt + (to % state->win_size), from, len);
}

static const char *part_probe_types[] = { "cmdlinepart", "RedBoot", NULL };
static const char * const part_probe_types[] = {
"cmdlinepart", "RedBoot", NULL };

/**
* gpio_flash_probe() - setup a mapping for a GPIO assisted flash
Expand Down
7 changes: 2 additions & 5 deletions drivers/mtd/maps/impa7.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,12 @@
#define NUM_FLASHBANKS 2
#define BUSWIDTH 4

/* can be { "cfi_probe", "jedec_probe", "map_rom", NULL } */
#define PROBETYPES { "jedec_probe", NULL }

#define MSG_PREFIX "impA7:" /* prefix for our printk()'s */
#define MTDID "impa7-%d" /* for mtdparts= partitioning */

static struct mtd_info *impa7_mtd[NUM_FLASHBANKS];

static const char * const rom_probe_types[] = { "jedec_probe", NULL };

static struct map_info impa7_map[NUM_FLASHBANKS] = {
{
Expand Down Expand Up @@ -60,8 +58,7 @@ static struct mtd_partition partitions[] =

static int __init init_impa7(void)
{
static const char *rom_probe_types[] = PROBETYPES;
const char **type;
const char * const *type;
int i;
static struct { u_long addr; u_long size; } pt[NUM_FLASHBANKS] = {
{ WINDOW_ADDR0, WINDOW_SIZE0 },
Expand Down
4 changes: 2 additions & 2 deletions drivers/mtd/maps/intel_vr_nor.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ static void vr_nor_destroy_mtd_setup(struct vr_nor_mtd *p)

static int vr_nor_mtd_setup(struct vr_nor_mtd *p)
{
static const char *probe_types[] =
static const char * const probe_types[] =
{ "cfi_probe", "jedec_probe", NULL };
const char **type;
const char * const *type;

for (type = probe_types; !p->info && *type; type++)
p->info = do_map_probe(*type, &p->map);
Expand Down
2 changes: 1 addition & 1 deletion drivers/mtd/maps/ixp4xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ struct ixp4xx_flash_info {
struct resource *res;
};

static const char *probes[] = { "RedBoot", "cmdlinepart", NULL };
static const char * const probes[] = { "RedBoot", "cmdlinepart", NULL };

static int ixp4xx_flash_remove(struct platform_device *dev)
{
Expand Down
3 changes: 1 addition & 2 deletions drivers/mtd/maps/lantiq-flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ struct ltq_mtd {
};

static const char ltq_map_name[] = "ltq_nor";
static const char *ltq_probe_types[] = {
"cmdlinepart", "ofpart", NULL };
static const char * const ltq_probe_types[] = { "cmdlinepart", "ofpart", NULL };

static map_word
ltq_read16(struct map_info *map, unsigned long adr)
Expand Down
3 changes: 1 addition & 2 deletions drivers/mtd/maps/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,7 @@ static int mtd_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
if (err)
goto release;

/* tsk - do_map_probe should take const char * */
mtd = do_map_probe((char *)info->map_name, &map->map);
mtd = do_map_probe(info->map_name, &map->map);
err = -ENODEV;
if (!mtd)
goto release;
Expand Down
4 changes: 1 addition & 3 deletions drivers/mtd/maps/pxa2xx-flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ struct pxa2xx_flash_info {
struct map_info map;
};


static const char *probes[] = { "RedBoot", "cmdlinepart", NULL };

static const char * const probes[] = { "RedBoot", "cmdlinepart", NULL };

static int pxa2xx_flash_probe(struct platform_device *pdev)
{
Expand Down
5 changes: 3 additions & 2 deletions drivers/mtd/maps/rbtx4939-flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,15 @@ static int rbtx4939_flash_remove(struct platform_device *dev)
return 0;
}

static const char *rom_probe_types[] = { "cfi_probe", "jedec_probe", NULL };
static const char * const rom_probe_types[] = {
"cfi_probe", "jedec_probe", NULL };

static int rbtx4939_flash_probe(struct platform_device *dev)
{
struct rbtx4939_flash_data *pdata;
struct rbtx4939_flash_info *info;
struct resource *res;
const char **probe_type;
const char * const *probe_type;
int err = 0;
unsigned long size;

Expand Down
2 changes: 1 addition & 1 deletion drivers/mtd/maps/sa1100-flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ static struct sa_info *sa1100_setup_mtd(struct platform_device *pdev,
return ERR_PTR(ret);
}

static const char *part_probes[] = { "cmdlinepart", "RedBoot", NULL };
static const char * const part_probes[] = { "cmdlinepart", "RedBoot", NULL };

static int sa1100_mtd_probe(struct platform_device *pdev)
{
Expand Down
2 changes: 1 addition & 1 deletion drivers/mtd/maps/solutionengine.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ struct map_info soleng_flash_map = {
.bankwidth = 4,
};

static const char *probes[] = { "RedBoot", "cmdlinepart", NULL };
static const char * const probes[] = { "RedBoot", "cmdlinepart", NULL };

#ifdef CONFIG_MTD_SUPERH_RESERVE
static struct mtd_partition superh_se_partitions[] = {
Expand Down
5 changes: 3 additions & 2 deletions drivers/mtd/maps/tsunami_flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,12 @@ static void __exit cleanup_tsunami_flash(void)
tsunami_flash_mtd = 0;
}

static const char * const rom_probe_types[] = {
"cfi_probe", "jedec_probe", "map_rom", NULL };

static int __init init_tsunami_flash(void)
{
static const char *rom_probe_types[] = { "cfi_probe", "jedec_probe", "map_rom", NULL };
char **type;
const char * const *type;

tsunami_tig_writeb(FLASH_ENABLE_BYTE, FLASH_ENABLE_PORT);

Expand Down

0 comments on commit 0984c89

Please sign in to comment.