aboutsummaryrefslogtreecommitdiff
path: root/external/opal-prd/module.c
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2015-03-11 17:15:07 +0800
committerStewart Smith <stewart@linux.vnet.ibm.com>2015-03-17 15:34:53 +1100
commit62aaaec7ab3c84c2226d5a89a5beb787a2e085f0 (patch)
tree5e29ce3a2c572a8c86243cf47a4be32211d91fc6 /external/opal-prd/module.c
parent4c33ce0ab8999672e8c2ef4088d3524be349e7bc (diff)
downloadskiboot-62aaaec7ab3c84c2226d5a89a5beb787a2e085f0.zip
skiboot-62aaaec7ab3c84c2226d5a89a5beb787a2e085f0.tar.gz
skiboot-62aaaec7ab3c84c2226d5a89a5beb787a2e085f0.tar.bz2
external/opal-prd: Unify logging calls and log to syslog
This change unifies the printf/fprintf/warn/err/perror calls into: pr_log(level, fmt, ...). While doing this, add prefixes to each message, to signify the functionality that raised the log message. We also add syslog initialisation, so that we can log to the system-wide syslog facility. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'external/opal-prd/module.c')
-rw-r--r--external/opal-prd/module.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/external/opal-prd/module.c b/external/opal-prd/module.c
index c483cd4..12fc3f9 100644
--- a/external/opal-prd/module.c
+++ b/external/opal-prd/module.c
@@ -20,7 +20,8 @@
#include <sys/types.h>
#include <sys/wait.h>
-#include <module.h>
+#include "module.h"
+#include "opal-prd.h"
int insert_module(const char *module)
{
@@ -35,18 +36,20 @@ int insert_module(const char *module)
pid = waitpid(pid, &status, 0);
if (pid < 0) {
- warn("waitpid failed for modprobe process");
+ pr_log(LOG_ERR, "KMOD: waitpid failed for "
+ "modprobe process: %m");
return -1;
}
if (!WIFEXITED(status)) {
- warnx("modprobe %s: process didn't exit cleanly", module);
+ pr_log(LOG_WARNING, "KMOD: modprobe %s: process didn't "
+ "exit cleanly", module);
return -1;
}
if (WEXITSTATUS(status) != 0) {
- warnx("modprobe %s failed, status %d", module,
- WEXITSTATUS(status));
+ pr_log(LOG_WARNING, "KMOD: modprobe %s failed, status %d",
+ module, WEXITSTATUS(status));
return -1;
}