projects
/
GitHub
/
mt8127
/
android_kernel_alcatel_ttab.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'for-linus' of git://neil.brown.name/md
[GitHub/mt8127/android_kernel_alcatel_ttab.git]
/
drivers
/
mtd
/
cmdlinepart.c
diff --git
a/drivers/mtd/cmdlinepart.c
b/drivers/mtd/cmdlinepart.c
index 23fab14f1637cab5fb4ee175ff5eaea6db141915..71bc07f149b7910f964a5bc9b4c678a149cfbdf9 100644
(file)
--- a/
drivers/mtd/cmdlinepart.c
+++ b/
drivers/mtd/cmdlinepart.c
@@
-1,6
+1,4
@@
/*
/*
- * $Id: cmdlinepart.c,v 1.19 2005/11/07 11:14:19 gleixner Exp $
- *
* Read flash partition table from command line
*
* Copyright 2002 SYSGO Real-Time Solutions GmbH
* Read flash partition table from command line
*
* Copyright 2002 SYSGO Real-Time Solutions GmbH
@@
-9,7
+7,7
@@
*
* mtdparts=<mtddef>[;<mtddef]
* <mtddef> := <mtd-id>:<partdef>[,<partdef>]
*
* mtdparts=<mtddef>[;<mtddef]
* <mtddef> := <mtd-id>:<partdef>[,<partdef>]
- * <partdef> := <size>[@offset][<name>][ro]
+ * <partdef> := <size>[@offset][<name>][ro]
[lk]
* <mtd-id> := unique name used in mapping driver/device (mtd->name)
* <size> := standard linux memsize OR "-" to denote all remaining space
* <name> := '(' NAME ')'
* <mtd-id> := unique name used in mapping driver/device (mtd->name)
* <size> := standard linux memsize OR "-" to denote all remaining space
* <name> := '(' NAME ')'
@@
-119,7
+117,8
@@
static struct mtd_partition * newpart(char *s,
char *p;
name = ++s;
char *p;
name = ++s;
- if ((p = strchr(name, delim)) == 0)
+ p = strchr(name, delim);
+ if (!p)
{
printk(KERN_ERR ERRP "no closing %c found in partition name\n", delim);
return NULL;
{
printk(KERN_ERR ERRP "no closing %c found in partition name\n", delim);
return NULL;
@@
-143,6
+142,13
@@
static struct mtd_partition * newpart(char *s,
s += 2;
}
s += 2;
}
+ /* if lk is found do NOT unlock the MTD partition*/
+ if (strncmp(s, "lk", 2) == 0)
+ {
+ mask_flags |= MTD_POWERUP_LOCK;
+ s += 2;
+ }
+
/* test if more partitions are following */
if (*s == ',')
{
/* test if more partitions are following */
if (*s == ',')
{
@@
-152,9
+158,10
@@
static struct mtd_partition * newpart(char *s,
return NULL;
}
/* more partitions follow, parse them */
return NULL;
}
/* more partitions follow, parse them */
- if ((parts = newpart(s + 1, &s, num_parts,
- this_part + 1, &extra_mem, extra_mem_size)) == 0)
- return NULL;
+ parts = newpart(s + 1, &s, num_parts, this_part + 1,
+ &extra_mem, extra_mem_size);
+ if (!parts)
+ return NULL;
}
else
{ /* this is the last partition: allocate space for all */
}
else
{ /* this is the last partition: allocate space for all */
@@
-299,10
+306,7
@@
static int parse_cmdline_partitions(struct mtd_info *master,
unsigned long offset;
int i;
struct cmdline_mtd_partition *part;
unsigned long offset;
int i;
struct cmdline_mtd_partition *part;
- char *mtd_id = master->name;
-
- if(!cmdline)
- return -EINVAL;
+ const char *mtd_id = master->name;
/* parse command line */
if (!cmdline_parsed)
/* parse command line */
if (!cmdline_parsed)
@@
-334,7
+338,7
@@
static int parse_cmdline_partitions(struct mtd_info *master,
return part->num_parts;
}
}
return part->num_parts;
}
}
- return
-EINVAL
;
+ return
0
;
}
}