summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ubi-utils/mtdinfo.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/ubi-utils/mtdinfo.c b/ubi-utils/mtdinfo.c
index d919673..ead4bce 100644
--- a/ubi-utils/mtdinfo.c
+++ b/ubi-utils/mtdinfo.c
@@ -340,7 +340,8 @@ static int print_dev_info(libmtd_t libmtd, const struct mtd_info *mtd_info, int
return 0;
}
-static int print_general_info(libmtd_t libmtd, const struct mtd_info *mtd_info)
+static int print_general_info(libmtd_t libmtd, const struct mtd_info *mtd_info,
+ int all)
{
int i, err, first = 1;
struct mtd_dev_info mtd;
@@ -367,9 +368,14 @@ static int print_general_info(libmtd_t libmtd, const struct mtd_info *mtd_info)
}
}
printf("\n");
- printf("Sysfs interface supported: %s\n\n",
+ printf("Sysfs interface supported: %s\n",
mtd_info->sysfs_supported ? "yes" : "no");
+ if (!all)
+ return 0;
+
+ printf("\n");
+
for (i = mtd_info->lowest_mtd_num;
i <= mtd_info->highest_mtd_num; i++) {
err = print_dev_info(libmtd, mtd_info, i);
@@ -404,7 +410,7 @@ int main(int argc, char * const argv[])
return sys_errmsg("cannot get MTD information");
}
- if (!args.all) {
+ if (!args.all && args.node) {
int mtdn;
/*
@@ -416,7 +422,7 @@ int main(int argc, char * const argv[])
goto out_libmtd;
err = print_dev_info(libmtd, &mtd_info, mtdn);
} else
- err = print_general_info(libmtd, &mtd_info);
+ err = print_general_info(libmtd, &mtd_info, args.all);
if (err)
goto out_libmtd;