edac: shell: Do not show error on ENODATA

In a case with ENODATA do not show error.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
This commit is contained in:
Andrei Emeltchenko 2022-04-14 16:15:41 +03:00 committed by Johan Hedberg
commit 8390ae5d70

View file

@ -62,7 +62,7 @@ static int ecc_error_show(const struct shell *sh, const struct device *dev)
int err;
err = edac_ecc_error_log_get(dev, &error);
if (err != 0) {
if (err != 0 && err != -ENODATA) {
shell_error(sh, "Error getting error log (err %d)", err);
return err;
}
@ -73,7 +73,7 @@ static int ecc_error_show(const struct shell *sh, const struct device *dev)
decode_ecc_error(sh, error);
}
return err;
return 0;
}
static int parity_error_show(const struct shell *sh, const struct device *dev)
@ -82,14 +82,14 @@ static int parity_error_show(const struct shell *sh, const struct device *dev)
int err;
err = edac_parity_error_log_get(dev, &error);
if (err != 0) {
if (err != 0 && err != -ENODATA) {
shell_error(sh, "Error getting parity error log (err %d)", err);
return err;
}
shell_fprintf(sh, SHELL_NORMAL, "Parity Error: 0x%llx\n", error);
return err;
return 0;
}
static int cmd_edac_info(const struct shell *shell, size_t argc, char **argv)