[PATCH] tpm: check mem start and len

The memory start and length values obtained from the ACPI entry need to be
checked and filled in with the default values from the specification if
they don't exist. This patch fills in the default values and uses them
appropriately.

Signed-off-by: Kylie Hall <kjhall@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by Kylene Jo Hall and committed by Linus Torvalds b09d5300 e496f540

+7
+7
drivers/char/tpm/tpm_tis.c
··· 52 52 }; 53 53 54 54 enum tis_defaults { 55 + TIS_MEM_BASE = 0xFED4000, 56 + TIS_MEM_LEN = 0x5000, 55 57 TIS_SHORT_TIMEOUT = 750, /* ms */ 56 58 TIS_LONG_TIMEOUT = 2000, /* 2 sec */ 57 59 }; ··· 438 436 439 437 start = pnp_mem_start(pnp_dev, 0); 440 438 len = pnp_mem_len(pnp_dev, 0); 439 + 440 + if (!start) 441 + start = TIS_MEM_BASE; 442 + if (!len) 443 + len = TIS_MEM_LEN; 441 444 442 445 if (!(chip = tpm_register_hardware(&pnp_dev->dev, &tpm_tis))) 443 446 return -ENODEV;