discover: Add debug output to sysparams parsing
authorJeremy Kerr <jk@ozlabs.org>
Mon, 10 Mar 2014 02:40:46 +0000 (10:40 +0800)
committerJeremy Kerr <jk@ozlabs.org>
Fri, 14 Mar 2014 07:14:26 +0000 (15:14 +0800)
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
discover/platform-powerpc.c

index 4eb28057c9fb6c7513a05c315cda8599c71cdc7c..d1f0575d5efb12863eb0a4a59ed116a50e990657 100644 (file)
@@ -540,16 +540,24 @@ static int read_bootdev_sysparam(const char *name, uint8_t *val)
        strcat(path, name);
 
        fd = open(path, O_RDONLY);
-       if (fd < 0)
+       if (fd < 0) {
+               pb_debug("powerpc: can't access sysparam %s\n",
+                               name);
                return -1;
+       }
 
        rc = read(fd, buf, sizeof(buf));
 
        close(fd);
 
        /* bootdev definitions should only be one byte in size */
-       if (rc != 1)
+       if (rc != 1) {
+               pb_debug("powerpc: sysparam %s read returned %d\n",
+                               name, rc);
                return -1;
+       }
+
+       pb_debug("powerpc: sysparam %s: 0x%02x\n", name, buf[0]);
 
        switch (buf[0]) {
        default: