diff options
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/core.c | 12 | ||||
-rw-r--r-- | drivers/mtd/devices/docg3.c | 4 | ||||
-rw-r--r-- | drivers/mtd/mtdoob.c | 2 | ||||
-rw-r--r-- | drivers/mtd/mtdraw.c | 2 | ||||
-rw-r--r-- | drivers/mtd/nand/nand-bb.c | 2 | ||||
-rw-r--r-- | drivers/mtd/nand/nand_imx_bbm.c | 2 | ||||
-rw-r--r-- | drivers/mtd/ubi/barebox.c | 4 | ||||
-rw-r--r-- | drivers/mtd/ubi/ubi-barebox.h | 3 | ||||
-rw-r--r-- | drivers/mtd/ubi/ubi.h | 1 |
9 files changed, 18 insertions, 14 deletions
diff --git a/drivers/mtd/core.c b/drivers/mtd/core.c index dcf94bfc0d..6d04b88553 100644 --- a/drivers/mtd/core.c +++ b/drivers/mtd/core.c @@ -470,10 +470,10 @@ static int mtd_partition_set(struct device_d *dev, struct param_d *p, const char static char *print_size(uint64_t s) { if (!(s & ((1 << 20) - 1))) - return asprintf("%lldM", s >> 20); + return basprintf("%lldM", s >> 20); if (!(s & ((1 << 10) - 1))) - return asprintf("%lldk", s >> 10); - return asprintf("0x%lld", s); + return basprintf("%lldk", s >> 10); + return basprintf("0x%lld", s); } static int print_part(char *buf, int bufsize, struct mtd_info *mtd, uint64_t last_ofs, @@ -577,7 +577,8 @@ static int of_mtd_fixup(struct device_node *root, void *ctx) list_for_each_entry(partmtd, &mtd->partitions, partitions_entry) { int na, ns, len = 0; - char *name = asprintf("partition@%0llx", partmtd->master_offset); + char *name = basprintf("partition@%0llx", + partmtd->master_offset); void *p; u8 tmp[16 * 16]; /* Up to 64-bit address + 64-bit size */ @@ -675,7 +676,8 @@ int add_mtd_device(struct mtd_info *mtd, const char *devname, int device_id) if (device_id == DEVICE_ID_SINGLE) mtd->cdev.name = xstrdup(devname); else - mtd->cdev.name = asprintf("%s%d", devname, mtd->class_dev.id); + mtd->cdev.name = basprintf("%s%d", devname, + mtd->class_dev.id); INIT_LIST_HEAD(&mtd->partitions); diff --git a/drivers/mtd/devices/docg3.c b/drivers/mtd/devices/docg3.c index 6a9bc74847..a40ba25632 100644 --- a/drivers/mtd/devices/docg3.c +++ b/drivers/mtd/devices/docg3.c @@ -1058,8 +1058,8 @@ static void __init doc_set_driver_info(int chip_id, struct mtd_info *mtd) switch (chip_id) { case DOC_CHIPID_G3: - mtd->name = asprintf("DiskOnChip G3 floor %d", - docg3->device_id); + mtd->name = basprintf("DiskOnChip G3 floor %d", + docg3->device_id); docg3->max_block = 2047; break; } diff --git a/drivers/mtd/mtdoob.c b/drivers/mtd/mtdoob.c index 4dcf2f5915..86076f028d 100644 --- a/drivers/mtd/mtdoob.c +++ b/drivers/mtd/mtdoob.c @@ -79,7 +79,7 @@ static int add_mtdoob_device(struct mtd_info *mtd, const char *devname, void **p mtdoob = xzalloc(sizeof(*mtdoob)); mtdoob->cdev.ops = &mtd_ops_oob; mtdoob->cdev.size = mtd_div_by_wb(mtd->size, mtd) * mtd->oobsize; - mtdoob->cdev.name = asprintf("%s.oob", mtd->cdev.name); + mtdoob->cdev.name = basprintf("%s.oob", mtd->cdev.name); mtdoob->cdev.priv = mtdoob; mtdoob->cdev.dev = &mtd->class_dev; mtdoob->mtd = mtd; diff --git a/drivers/mtd/mtdraw.c b/drivers/mtd/mtdraw.c index 4d6ac72bd9..b06eb18f3f 100644 --- a/drivers/mtd/mtdraw.c +++ b/drivers/mtd/mtdraw.c @@ -308,7 +308,7 @@ static int add_mtdraw_device(struct mtd_info *mtd, const char *devname, void **p mtdraw->cdev.ops = (struct file_operations *)&mtd_raw_fops; mtdraw->cdev.size = mtd_div_by_wb(mtd->size, mtd) * (mtd->writesize + mtd->oobsize); - mtdraw->cdev.name = asprintf("%s.raw", mtd->cdev.name); + mtdraw->cdev.name = basprintf("%s.raw", mtd->cdev.name); mtdraw->cdev.priv = mtdraw; mtdraw->cdev.dev = &mtd->class_dev; mtdraw->cdev.mtd = mtd; diff --git a/drivers/mtd/nand/nand-bb.c b/drivers/mtd/nand/nand-bb.c index e6d42772b3..015f8dc524 100644 --- a/drivers/mtd/nand/nand-bb.c +++ b/drivers/mtd/nand/nand-bb.c @@ -288,7 +288,7 @@ struct cdev *mtd_add_bb(struct mtd_info *mtd, const char *name) if (name) bb->cdev.name = xstrdup(name); else - bb->cdev.name = asprintf("%s.bb", mtd->cdev.name); + bb->cdev.name = basprintf("%s.bb", mtd->cdev.name); nand_bb_calc_size(bb); bb->cdev.ops = &nand_bb_ops; diff --git a/drivers/mtd/nand/nand_imx_bbm.c b/drivers/mtd/nand/nand_imx_bbm.c index 5caa0a26c3..251dfe5d3f 100644 --- a/drivers/mtd/nand/nand_imx_bbm.c +++ b/drivers/mtd/nand/nand_imx_bbm.c @@ -188,7 +188,7 @@ static int do_imx_nand_bbm(int argc, char *argv[]) int c; printf("create flash bbt (y/n)?"); - c = getc(); + c = getchar(); if (c == 'y') yes = 1; printf("\n"); diff --git a/drivers/mtd/ubi/barebox.c b/drivers/mtd/ubi/barebox.c index c26a2455b2..ad38e69ea5 100644 --- a/drivers/mtd/ubi/barebox.c +++ b/drivers/mtd/ubi/barebox.c @@ -176,7 +176,7 @@ int ubi_volume_cdev_add(struct ubi_device *ubi, struct ubi_volume *vol) priv->ubi = ubi; cdev->ops = &ubi_volume_fops; - cdev->name = asprintf("%s.%s", ubi->cdev.name, vol->name); + cdev->name = basprintf("%s.%s", ubi->cdev.name, vol->name); cdev->priv = priv; cdev->size = vol->used_bytes; cdev->dev = &vol->dev; @@ -239,7 +239,7 @@ int ubi_cdev_add(struct ubi_device *ubi) int ret; cdev->ops = &ubi_fops; - cdev->name = asprintf("%s.ubi", ubi->mtd->cdev.name); + cdev->name = basprintf("%s.ubi", ubi->mtd->cdev.name); cdev->priv = ubi; cdev->size = 0; diff --git a/drivers/mtd/ubi/ubi-barebox.h b/drivers/mtd/ubi/ubi-barebox.h index ab970aa19d..557ad88316 100644 --- a/drivers/mtd/ubi/ubi-barebox.h +++ b/drivers/mtd/ubi/ubi-barebox.h @@ -16,6 +16,7 @@ #include <common.h> #include <malloc.h> +#include <crc.h> #include <asm-generic/div64.h> #include <errno.h> #include <linux/err.h> @@ -26,7 +27,7 @@ #include <linux/mtd/mtd.h> #include <linux/mtd/ubi.h> -#define crc32(seed, data, length) crc32_no_comp(seed, (unsigned char const *)data, length) +#define crc32(seed, data, length) crc32_no_comp(seed, (unsigned char * const)data, length) /* configurable */ #define CONFIG_MTD_UBI_WL_THRESHOLD 4096 diff --git a/drivers/mtd/ubi/ubi.h b/drivers/mtd/ubi/ubi.h index a8ed0d7710..471d784234 100644 --- a/drivers/mtd/ubi/ubi.h +++ b/drivers/mtd/ubi/ubi.h @@ -20,6 +20,7 @@ #include <common.h> #include <malloc.h> +#include <crc.h> #include <linux/types.h> #include <linux/list.h> #include <linux/rbtree.h> |