mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 01:10:04 +00:00
mtd: cmdlinepart: convert printk() to pr_*()
This driver uses some custom macros for printing. Let's use the standard pr_fmt()/pr_{err,warn}(). Signed-off-by: Brian Norris <computersforpeace@gmail.com>
This commit is contained in:
parent
d855d23b56
commit
ecb43e0a5f
1 changed files with 11 additions and 14 deletions
|
@ -48,6 +48,8 @@
|
||||||
* edb7312-nor:256k(ARMboot)ro,-(root);edb7312-nand:-(home)
|
* edb7312-nor:256k(ARMboot)ro,-(root);edb7312-nand:-(home)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define pr_fmt(fmt) "mtd: " fmt
|
||||||
|
|
||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
#include <linux/mtd/mtd.h>
|
#include <linux/mtd/mtd.h>
|
||||||
|
@ -55,9 +57,6 @@
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/err.h>
|
#include <linux/err.h>
|
||||||
|
|
||||||
/* error message prefix */
|
|
||||||
#define ERRP "mtd: "
|
|
||||||
|
|
||||||
/* debug macro */
|
/* debug macro */
|
||||||
#if 0
|
#if 0
|
||||||
#define dbg(x) do { printk("DEBUG-CMDLINE-PART: "); printk x; } while(0)
|
#define dbg(x) do { printk("DEBUG-CMDLINE-PART: "); printk x; } while(0)
|
||||||
|
@ -116,7 +115,7 @@ static struct mtd_partition * newpart(char *s,
|
||||||
} else {
|
} else {
|
||||||
size = memparse(s, &s);
|
size = memparse(s, &s);
|
||||||
if (!size) {
|
if (!size) {
|
||||||
printk(KERN_ERR ERRP "partition has size 0\n");
|
pr_err("partition has size 0\n");
|
||||||
return ERR_PTR(-EINVAL);
|
return ERR_PTR(-EINVAL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -141,7 +140,7 @@ static struct mtd_partition * newpart(char *s,
|
||||||
name = ++s;
|
name = ++s;
|
||||||
p = strchr(name, delim);
|
p = strchr(name, delim);
|
||||||
if (!p) {
|
if (!p) {
|
||||||
printk(KERN_ERR ERRP "no closing %c found in partition name\n", delim);
|
pr_err("no closing %c found in partition name\n", delim);
|
||||||
return ERR_PTR(-EINVAL);
|
return ERR_PTR(-EINVAL);
|
||||||
}
|
}
|
||||||
name_len = p - name;
|
name_len = p - name;
|
||||||
|
@ -169,7 +168,7 @@ static struct mtd_partition * newpart(char *s,
|
||||||
/* test if more partitions are following */
|
/* test if more partitions are following */
|
||||||
if (*s == ',') {
|
if (*s == ',') {
|
||||||
if (size == SIZE_REMAINING) {
|
if (size == SIZE_REMAINING) {
|
||||||
printk(KERN_ERR ERRP "no partitions allowed after a fill-up partition\n");
|
pr_err("no partitions allowed after a fill-up partition\n");
|
||||||
return ERR_PTR(-EINVAL);
|
return ERR_PTR(-EINVAL);
|
||||||
}
|
}
|
||||||
/* more partitions follow, parse them */
|
/* more partitions follow, parse them */
|
||||||
|
@ -236,7 +235,7 @@ static int mtdpart_setup_real(char *s)
|
||||||
/* fetch <mtd-id> */
|
/* fetch <mtd-id> */
|
||||||
p = strchr(s, ':');
|
p = strchr(s, ':');
|
||||||
if (!p) {
|
if (!p) {
|
||||||
printk(KERN_ERR ERRP "no mtd-id\n");
|
pr_err("no mtd-id\n");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
mtd_id_len = p - mtd_id;
|
mtd_id_len = p - mtd_id;
|
||||||
|
@ -288,7 +287,7 @@ static int mtdpart_setup_real(char *s)
|
||||||
|
|
||||||
/* does another spec follow? */
|
/* does another spec follow? */
|
||||||
if (*s != ';') {
|
if (*s != ';') {
|
||||||
printk(KERN_ERR ERRP "bad character after partition (%c)\n", *s);
|
pr_err("bad character after partition (%c)\n", *s);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
s++;
|
s++;
|
||||||
|
@ -342,17 +341,15 @@ static int parse_cmdline_partitions(struct mtd_info *master,
|
||||||
part->parts[i].size = master->size - offset;
|
part->parts[i].size = master->size - offset;
|
||||||
|
|
||||||
if (offset + part->parts[i].size > master->size) {
|
if (offset + part->parts[i].size > master->size) {
|
||||||
printk(KERN_WARNING ERRP
|
pr_warn("%s: partitioning exceeds flash size, truncating\n",
|
||||||
"%s: partitioning exceeds flash size, truncating\n",
|
part->mtd_id);
|
||||||
part->mtd_id);
|
|
||||||
part->parts[i].size = master->size - offset;
|
part->parts[i].size = master->size - offset;
|
||||||
}
|
}
|
||||||
offset += part->parts[i].size;
|
offset += part->parts[i].size;
|
||||||
|
|
||||||
if (part->parts[i].size == 0) {
|
if (part->parts[i].size == 0) {
|
||||||
printk(KERN_WARNING ERRP
|
pr_warn("%s: skipping zero sized partition\n",
|
||||||
"%s: skipping zero sized partition\n",
|
part->mtd_id);
|
||||||
part->mtd_id);
|
|
||||||
part->num_parts--;
|
part->num_parts--;
|
||||||
memmove(&part->parts[i], &part->parts[i + 1],
|
memmove(&part->parts[i], &part->parts[i + 1],
|
||||||
sizeof(*part->parts) * (part->num_parts - i));
|
sizeof(*part->parts) * (part->num_parts - i));
|
||||||
|
|
Loading…
Reference in a new issue