summaryrefslogtreecommitdiffstats
path: root/drivers/char/tpm/tpm_of.c
diff options
context:
space:
mode:
authorNayna Jain <nayna@linux.vnet.ibm.com>2016-11-14 11:00:56 +0100
committerJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>2016-11-28 00:31:32 +0100
commit5efae7d6b07f37939f8f99d0983d5346f0c3e4e6 (patch)
treea3d494c00264c8a6df14d5e1f6bef92ed4b298ac /drivers/char/tpm/tpm_of.c
parenttpm: replace of_find_node_by_name() with dev of_node property (diff)
downloadlinux-5efae7d6b07f37939f8f99d0983d5346f0c3e4e6.tar.xz
linux-5efae7d6b07f37939f8f99d0983d5346f0c3e4e6.zip
tpm: cleanup of printk error messages
This patch removes the unnecessary error messages on failing to allocate memory and replaces pr_err/printk with dev_dbg/dev_info as applicable. Suggested-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> Signed-off-by: Nayna Jain <nayna@linux.vnet.ibm.com> Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Tested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Diffstat (limited to 'drivers/char/tpm/tpm_of.c')
-rw-r--r--drivers/char/tpm/tpm_of.c29
1 files changed, 9 insertions, 20 deletions
diff --git a/drivers/char/tpm/tpm_of.c b/drivers/char/tpm/tpm_of.c
index 12a86dda3b69..643cc8ccb35b 100644
--- a/drivers/char/tpm/tpm_of.c
+++ b/drivers/char/tpm/tpm_of.c
@@ -31,40 +31,29 @@ int tpm_read_log_of(struct tpm_chip *chip)
log = &chip->log;
if (chip->dev.parent->of_node)
np = chip->dev.parent->of_node;
- if (!np) {
- pr_err("%s: ERROR - IBMVTPM not supported\n", __func__);
+ if (!np)
return -ENODEV;
- }
sizep = of_get_property(np, "linux,sml-size", NULL);
- if (sizep == NULL) {
- pr_err("%s: ERROR - SML size not found\n", __func__);
- goto cleanup_eio;
- }
+ if (sizep == NULL)
+ return -EIO;
+
if (*sizep == 0) {
- pr_err("%s: ERROR - event log area empty\n", __func__);
- goto cleanup_eio;
+ dev_warn(&chip->dev, "%s: Event log area empty\n", __func__);
+ return -EIO;
}
basep = of_get_property(np, "linux,sml-base", NULL);
- if (basep == NULL) {
- pr_err("%s: ERROR - SML not found\n", __func__);
- goto cleanup_eio;
- }
+ if (basep == NULL)
+ return -EIO;
log->bios_event_log = kmalloc(*sizep, GFP_KERNEL);
- if (!log->bios_event_log) {
- pr_err("%s: ERROR - Not enough memory for BIOS measurements\n",
- __func__);
+ if (!log->bios_event_log)
return -ENOMEM;
- }
log->bios_event_log_end = log->bios_event_log + *sizep;
memcpy(log->bios_event_log, __va(*basep), *sizep);
return 0;
-
-cleanup_eio:
- return -EIO;
}