Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
strcat(path, name);
fd = open(path, O_RDONLY);
strcat(path, name);
fd = open(path, O_RDONLY);
+ if (fd < 0) {
+ pb_debug("powerpc: can't access sysparam %s\n",
+ name);
rc = read(fd, buf, sizeof(buf));
close(fd);
/* bootdev definitions should only be one byte in size */
rc = read(fd, buf, sizeof(buf));
close(fd);
/* bootdev definitions should only be one byte in size */
+ if (rc != 1) {
+ pb_debug("powerpc: sysparam %s read returned %d\n",
+ name, rc);
+ }
+
+ pb_debug("powerpc: sysparam %s: 0x%02x\n", name, buf[0]);
switch (buf[0]) {
default:
switch (buf[0]) {
default: