Skip to content

Commit 9685431

Browse files
stefanbergerxjamesmorris
authored andcommitted
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>
1 parent 6eb77b2 commit 9685431

1 file changed

Lines changed: 23 additions & 22 deletions

File tree

‎drivers/char/tpm/tpm_tis.c‎

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -726,6 +726,29 @@ static int tpm_tis_init(struct device *dev, resource_size_t start,
726726
tpm_remove_hardware(chip->dev);
727727
return rc;
728728
}
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+
729752
#ifdef CONFIG_PNP
730753
static int __devinit tpm_tis_pnp_init(struct pnp_dev *pnp_dev,
731754
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)
752775
return tpm_pm_suspend(&dev->dev, msg);
753776
}
754777

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-
777778
static int tpm_tis_pnp_resume(struct pnp_dev *dev)
778779
{
779780
struct tpm_chip *chip = pnp_get_drvdata(dev);

0 commit comments

Comments
 (0)