summaryrefslogtreecommitdiff
path: root/drivers/mtd/maps
diff options
context:
space:
mode:
authorAshutosh Patel <ashutoshp@nvidia.com>2013-02-11 16:10:42 +0530
committerDan Willemsen <dwillemsen@nvidia.com>2013-09-14 12:57:31 -0700
commit27fb83124822af537598499bdfe5a663980be5b6 (patch)
tree63fe630a8cff85c1e61749b61d50810342581f73 /drivers/mtd/maps
parentddc718df285033cbb77b16cbef98b150b0a95c35 (diff)
driver: nor: tegra: Correct Module detection logic
- Removed return EIO statement to detect half flash if single NOR flash module is connected bug 1234582 Change-Id: I4d7d2a9b871566cd23509eaaa5140fb093a164c1 Signed-off-by: Ashutosh Patel <ashutoshp@nvidia.com> Reviewed-on: http://git-master/r/199384 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Diffstat (limited to 'drivers/mtd/maps')
-rw-r--r--drivers/mtd/maps/tegra_nor_gmi.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/drivers/mtd/maps/tegra_nor_gmi.c b/drivers/mtd/maps/tegra_nor_gmi.c
index 1e818086572f..306dfd932546 100644
--- a/drivers/mtd/maps/tegra_nor_gmi.c
+++ b/drivers/mtd/maps/tegra_nor_gmi.c
@@ -484,10 +484,9 @@ static int flash_probe(struct tegra_nor_info *info)
for (i = 0; i < info->n_maps; i++) {
map = &map_list[i];
mtd[i] = do_map_probe(info->plat->flash.map_name, map);
- if (mtd[i] == NULL) {
+ if (mtd[i] == NULL)
dev_err(dev, "cannot probe flash\n");
- return -EIO;
- } else {
+ else {
present_banks++;
size += map->size;
}
@@ -495,13 +494,17 @@ static int flash_probe(struct tegra_nor_info *info)
}
info->mtd = mtd;
- if (present_banks < info->n_maps)
- info->concat_mtd = mtd_concat_create(info->mtd, present_banks,
- DRV_NAME);
- else
- info->concat_mtd = mtd_concat_create(info->mtd, info->n_maps,
- DRV_NAME);
+ if (present_banks == 0) {
+ return -EIO;
+ } else{
+ if (present_banks < info->n_maps)
+ info->concat_mtd = mtd_concat_create(info->mtd,
+ present_banks, DRV_NAME);
+ else
+ info->concat_mtd = mtd_concat_create(info->mtd,
+ info->n_maps, DRV_NAME);
+ }
if (!info->concat_mtd) {
dev_err(dev, "cannot concatenate flash\n");
return -ENODEV;