All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] infineon tpm build fix
@ 2005-11-11 15:32 Gerd Knorr
  0 siblings, 0 replies; only message in thread
From: Gerd Knorr @ 2005-11-11 15:32 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: Type: text/plain, Size: 227 bytes --]

   Hi,

The attached patch is for the 
http://xenbits.xensource.com/linux-2.6-xen.hg linux kernel source tree. 
  It adapts the infinion tpm driver to the general tpm changes and is 
needed to build it.

please apply,

   Gerd

[-- Attachment #2: xen3-fixup-common-tpm-infineon --]
[-- Type: text/plain, Size: 3791 bytes --]

Index: linux-2.6.14-xen/drivers/char/tpm/tpm_infineon.c
===================================================================
--- linux-2.6.14-xen.orig/drivers/char/tpm/tpm_infineon.c	2005-10-28 02:02:08.000000000 +0200
+++ linux-2.6.14-xen/drivers/char/tpm/tpm_infineon.c	2005-11-11 16:04:16.000000000 +0100
@@ -143,10 +143,10 @@ static int wait(struct tpm_chip *chip, i
 	}
 	if (i == TPM_MAX_TRIES) {	/* timeout occurs */
 		if (wait_for_bit == STAT_XFE)
-			dev_err(&chip->pci_dev->dev,
+			dev_err(chip->dev,
 				"Timeout in wait(STAT_XFE)\n");
 		if (wait_for_bit == STAT_RDA)
-			dev_err(&chip->pci_dev->dev,
+			dev_err(chip->dev,
 				"Timeout in wait(STAT_RDA)\n");
 		return -EIO;
 	}
@@ -170,7 +170,7 @@ static void wait_and_send(struct tpm_chi
 static void tpm_wtx(struct tpm_chip *chip)
 {
 	number_of_wtx++;
-	dev_info(&chip->pci_dev->dev, "Granting WTX (%02d / %02d)\n",
+	dev_info(chip->dev, "Granting WTX (%02d / %02d)\n",
 		 number_of_wtx, TPM_MAX_WTX_PACKAGES);
 	wait_and_send(chip, TPM_VL_VER);
 	wait_and_send(chip, TPM_CTRL_WTX);
@@ -181,7 +181,7 @@ static void tpm_wtx(struct tpm_chip *chi
 
 static void tpm_wtx_abort(struct tpm_chip *chip)
 {
-	dev_info(&chip->pci_dev->dev, "Aborting WTX\n");
+	dev_info(chip->dev, "Aborting WTX\n");
 	wait_and_send(chip, TPM_VL_VER);
 	wait_and_send(chip, TPM_CTRL_WTX_ABORT);
 	wait_and_send(chip, 0x00);
@@ -206,7 +206,7 @@ recv_begin:
 	}
 
 	if (buf[0] != TPM_VL_VER) {
-		dev_err(&chip->pci_dev->dev,
+		dev_err(chip->dev,
 			"Wrong transport protocol implementation!\n");
 		return -EIO;
 	}
@@ -221,7 +221,7 @@ recv_begin:
 		}
 
 		if ((size == 0x6D00) && (buf[1] == 0x80)) {
-			dev_err(&chip->pci_dev->dev,
+			dev_err(chip->dev,
 				"Error handling on vendor layer!\n");
 			return -EIO;
 		}
@@ -234,7 +234,7 @@ recv_begin:
 	}
 
 	if (buf[1] == TPM_CTRL_WTX) {
-		dev_info(&chip->pci_dev->dev, "WTX-package received\n");
+		dev_info(chip->dev, "WTX-package received\n");
 		if (number_of_wtx < TPM_MAX_WTX_PACKAGES) {
 			tpm_wtx(chip);
 			goto recv_begin;
@@ -245,14 +245,14 @@ recv_begin:
 	}
 
 	if (buf[1] == TPM_CTRL_WTX_ABORT_ACK) {
-		dev_info(&chip->pci_dev->dev, "WTX-abort acknowledged\n");
+		dev_info(chip->dev, "WTX-abort acknowledged\n");
 		return size;
 	}
 
 	if (buf[1] == TPM_CTRL_ERROR) {
-		dev_err(&chip->pci_dev->dev, "ERROR-package received:\n");
+		dev_err(chip->dev, "ERROR-package received:\n");
 		if (buf[4] == TPM_INF_NAK)
-			dev_err(&chip->pci_dev->dev,
+			dev_err(chip->dev,
 				"-> Negative acknowledgement"
 				" - retransmit command!\n");
 		return -EIO;
@@ -271,7 +271,7 @@ static int tpm_inf_send(struct tpm_chip 
 
 	ret = empty_fifo(chip, 1);
 	if (ret) {
-		dev_err(&chip->pci_dev->dev, "Timeout while clearing FIFO\n");
+		dev_err(chip->dev, "Timeout while clearing FIFO\n");
 		return -EIO;
 	}
 
@@ -488,7 +488,7 @@ static int __devinit tpm_inf_probe(struc
 			 vendorid[0], vendorid[1],
 			 productid[0], productid[1], chipname);
 
-		rc = tpm_register_hardware(pci_dev, &tpm_inf);
+		rc = tpm_register_hardware(&pci_dev->dev, &tpm_inf);
 		if (rc < 0)
 			goto error;
 		return 0;
@@ -503,6 +503,14 @@ error2:
 	}
 }
 
+static void __devexit tpm_inf_remove(struct pci_dev *pci_dev)
+{
+	struct tpm_chip *chip = pci_get_drvdata(pci_dev);
+
+	if (chip)
+		tpm_remove_hardware(chip->dev);
+}
+
 static struct pci_device_id tpm_pci_tbl[] __devinitdata = {
 	{PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_0)},
 	{PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_12)},
@@ -521,7 +529,7 @@ static struct pci_driver inf_pci_driver 
 	.name = "tpm_inf",
 	.id_table = tpm_pci_tbl,
 	.probe = tpm_inf_probe,
-	.remove = __devexit_p(tpm_remove),
+	.remove = __devexit_p(tpm_inf_remove),
 	.suspend = tpm_pm_suspend,
 	.resume = tpm_pm_resume,
 };

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-11-11 15:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-11 15:32 [patch] infineon tpm build fix Gerd Knorr

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.