Skip to content

Commit

Permalink
tpm, tpm_crb: Handle 64-bit resource in crb_check_resource()
Browse files Browse the repository at this point in the history
crb_check_resource() in TPM CRB driver calls
acpi_dev_resource_memory() which only handles 32-bit resources.
Adding a call to acpi_dev_resource_address_space() in TPM CRB
driver which handles 64-bit resources.

Signed-off-by: Jiandi An <[email protected]>
Reviewed-by: Jarkko Sakkinen <[email protected]>
Tested-by: Jarkko Sakkinen <[email protected]>
Signed-off-by: Jarkko Sakkinen <[email protected]>
  • Loading branch information
Jiandi An authored and Jarkko Sakkinen committed Jan 23, 2017
1 parent aea7f54 commit 19b7bf5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions drivers/char/tpm/tpm_crb.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,12 @@ static const struct tpm_class_ops tpm_crb = {
static int crb_check_resource(struct acpi_resource *ares, void *data)
{
struct resource *io_res = data;
struct resource res;
struct resource_win win;
struct resource *res = &(win.res);

if (acpi_dev_resource_memory(ares, &res)) {
*io_res = res;
if (acpi_dev_resource_memory(ares, res) ||
acpi_dev_resource_address_space(ares, &win)) {
*io_res = *res;
io_res->name = NULL;
}

Expand Down

0 comments on commit 19b7bf5

Please sign in to comment.