intel/skylake/pcr.c: error out on invalid size in pcr read/write

The read and write routines take a number of bytes to write, which
should be 1,2, or 4.  We now return an error if an invalid size
is specified.

Change-Id: I93344bc0837c3715fc7660503f405c8878eb711c
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/12936
Tested-by: build bot (Jenkins)
Reviewed-by: Nico Huber <nico.h@gmx.de>
This commit is contained in:
Martin Roth 2016-01-13 11:54:18 -07:00
parent a6e7702787
commit baf00e6b28
1 changed files with 2 additions and 2 deletions

View File

@ -63,7 +63,7 @@ static int pch_pcr_read(u8 pid, u16 offset, u32 size, void *data)
*(u8 *) data = read8(pcr_reg_address(pid, offset)); *(u8 *) data = read8(pcr_reg_address(pid, offset));
break; break;
default: default:
break; return -1;
} }
return 0; return 0;
} }
@ -123,7 +123,7 @@ static int pch_pcr_write(u8 pid, u16 offset, u32 size, u32 data)
write8(pcr_reg_address(pid, offset), (u8) data); write8(pcr_reg_address(pid, offset), (u8) data);
break; break;
default: default:
break; return -1;
} }
/* Ensure the writes complete. */ /* Ensure the writes complete. */
complete_write(); complete_write();