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