summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/devices
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2013-10-28 12:45:56 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2013-10-29 09:10:21 +0100
commitd317b1bf8500dc67adfb5903119fef28adb4b4c1 (patch)
treea1a67919b728a3364a222122e29a663128631b8d /drivers/mtd/devices
parent865bab03473465ef67c069fc9209911cb6faf367 (diff)
downloadbarebox-d317b1bf8500dc67adfb5903119fef28adb4b4c1.tar.gz
barebox-d317b1bf8500dc67adfb5903119fef28adb4b4c1.tar.xz
mtd: Pass device_id to add_mtd_device
Right now we do not support persistent names for mtd devices. The base name can be passed to add_mtd_device, but this is always appended with a dynamic number. With this patch add_mtd_device takes a device_id argument which can be used to create a mtd device with an exact name. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/mtd/devices')
-rw-r--r--drivers/mtd/devices/docg3.c2
-rw-r--r--drivers/mtd/devices/m25p80.c4
-rw-r--r--drivers/mtd/devices/mtd_dataflash.c2
3 files changed, 3 insertions, 5 deletions
diff --git a/drivers/mtd/devices/docg3.c b/drivers/mtd/devices/docg3.c
index e15c809520..9ae606b3d8 100644
--- a/drivers/mtd/devices/docg3.c
+++ b/drivers/mtd/devices/docg3.c
@@ -1173,7 +1173,7 @@ static int __init docg3_probe(struct device_d *dev)
}
docg3_floors[floor] = mtd;
mtd->parent = dev;
- ret = add_mtd_device(mtd, NULL);
+ ret = add_mtd_device(mtd, NULL, DEVICE_ID_DYNAMIC);
if (ret)
goto err_probe;
found++;
diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
index 57fe1f27ef..429ddf6f08 100644
--- a/drivers/mtd/devices/m25p80.c
+++ b/drivers/mtd/devices/m25p80.c
@@ -942,9 +942,7 @@ static int m25p_probe(struct device_d *dev)
flash->mtd.eraseregions[i].erasesize / 1024,
flash->mtd.eraseregions[i].numblocks);
-
-
- return add_mtd_device(&flash->mtd, flash->mtd.name);
+ return add_mtd_device(&flash->mtd, flash->mtd.name, DEVICE_ID_DYNAMIC);
}
static __maybe_unused struct of_device_id m25p80_dt_ids[] = {
diff --git a/drivers/mtd/devices/mtd_dataflash.c b/drivers/mtd/devices/mtd_dataflash.c
index 52bd84266c..d785e33dae 100644
--- a/drivers/mtd/devices/mtd_dataflash.c
+++ b/drivers/mtd/devices/mtd_dataflash.c
@@ -643,7 +643,7 @@ add_dataflash_otp(struct spi_device *spi, char *name,
name, (long long)((device->size + 1023) >> 10),
pagesize, otp_tag);
- err = add_mtd_device(device, device->name);
+ err = add_mtd_device(device, device->name, DEVICE_ID_DYNAMIC);
if (!err)
return 0;