diff options
| author | Stefan Berger <stefanb@linux.vnet.ibm.com> | 2011-07-17 01:04:24 -0400 |
|---|---|---|
| committer | James Morris <jmorris@namei.org> | 2011-07-22 03:33:24 -0400 |
| commit | 968543100a75bef892f52eb86e92e83b3b7bc581 (patch) | |
| tree | 7a17de7337e3646641eed445532f0d71bc0f65c7 | |
| parent | 6eb77b214985f8c2568f1f20f941790fbf8bf97b (diff) | |
tpm: Move tpm_tis_reenable_interrupts out of CONFIG_PNP block
This patch moves the tpm_tis_reenable_interrupts function out of the
CONFIG_PNP-surrounded #define block. This solves a compilation error in
case CONFIG_PNP is not defined.
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Acked-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: James Morris <jmorris@namei.org>
| -rw-r--r-- | drivers/char/tpm/tpm_tis.c | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c index 2cf49b4168ae..7fc2f108f490 100644 --- a/drivers/char/tpm/tpm_tis.c +++ b/drivers/char/tpm/tpm_tis.c | |||
| @@ -726,6 +726,29 @@ out_err: | |||
| 726 | tpm_remove_hardware(chip->dev); | 726 | tpm_remove_hardware(chip->dev); |
| 727 | return rc; | 727 | return rc; |
| 728 | } | 728 | } |
| 729 | |||
| 730 | static void tpm_tis_reenable_interrupts(struct tpm_chip *chip) | ||
| 731 | { | ||
| 732 | u32 intmask; | ||
| 733 | |||
| 734 | /* reenable interrupts that device may have lost or | ||
| 735 | BIOS/firmware may have disabled */ | ||
| 736 | iowrite8(chip->vendor.irq, chip->vendor.iobase + | ||
| 737 | TPM_INT_VECTOR(chip->vendor.locality)); | ||
| 738 | |||
| 739 | intmask = | ||
| 740 | ioread32(chip->vendor.iobase + | ||
| 741 | TPM_INT_ENABLE(chip->vendor.locality)); | ||
| 742 | |||
| 743 | intmask |= TPM_INTF_CMD_READY_INT | ||
| 744 | | TPM_INTF_LOCALITY_CHANGE_INT | TPM_INTF_DATA_AVAIL_INT | ||
| 745 | | TPM_INTF_STS_VALID_INT | TPM_GLOBAL_INT_ENABLE; | ||
| 746 | |||
| 747 | iowrite32(intmask, | ||
| 748 | chip->vendor.iobase + TPM_INT_ENABLE(chip->vendor.locality)); | ||
| 749 | } | ||
| 750 | |||
| 751 | |||
| 729 | #ifdef CONFIG_PNP | 752 | #ifdef CONFIG_PNP |
| 730 | static int __devinit tpm_tis_pnp_init(struct pnp_dev *pnp_dev, | 753 | static int __devinit tpm_tis_pnp_init(struct pnp_dev *pnp_dev, |
| 731 | const struct pnp_device_id *pnp_id) | 754 | const struct pnp_device_id *pnp_id) |
| @@ -752,28 +775,6 @@ static int tpm_tis_pnp_suspend(struct pnp_dev *dev, pm_message_t msg) | |||
| 752 | return tpm_pm_suspend(&dev->dev, msg); | 775 | return tpm_pm_suspend(&dev->dev, msg); |
| 753 | } | 776 | } |
| 754 | 777 | ||
| 755 | static void tpm_tis_reenable_interrupts(struct tpm_chip *chip) | ||
| 756 | { | ||
| 757 | u32 intmask; | ||
| 758 | |||
| 759 | /* reenable interrupts that device may have lost or | ||
| 760 | BIOS/firmware may have disabled */ | ||
| 761 | iowrite8(chip->vendor.irq, chip->vendor.iobase + | ||
| 762 | TPM_INT_VECTOR(chip->vendor.locality)); | ||
| 763 | |||
| 764 | intmask = | ||
| 765 | ioread32(chip->vendor.iobase + | ||
| 766 | TPM_INT_ENABLE(chip->vendor.locality)); | ||
| 767 | |||
| 768 | intmask |= TPM_INTF_CMD_READY_INT | ||
| 769 | | TPM_INTF_LOCALITY_CHANGE_INT | TPM_INTF_DATA_AVAIL_INT | ||
| 770 | | TPM_INTF_STS_VALID_INT | TPM_GLOBAL_INT_ENABLE; | ||
| 771 | |||
| 772 | iowrite32(intmask, | ||
| 773 | chip->vendor.iobase + TPM_INT_ENABLE(chip->vendor.locality)); | ||
| 774 | } | ||
| 775 | |||
| 776 | |||
| 777 | static int tpm_tis_pnp_resume(struct pnp_dev *dev) | 778 | static int tpm_tis_pnp_resume(struct pnp_dev *dev) |
| 778 | { | 779 | { |
| 779 | struct tpm_chip *chip = pnp_get_drvdata(dev); | 780 | struct tpm_chip *chip = pnp_get_drvdata(dev); |
