Please apply these fixes to the Tpm driver. I am resubmitting the entire
patch set that was orginally sent to LKML on April 27 with the changes
that were requested fixed.
Thanks,
Kylie
On Wed, 9 Mar 2005, Jeff Garzik wrote:
> Greg KH wrote:
<snip>
> > +static ssize_t show_pcrs(struct device *dev, char *buf)
> > +{
> > + u8 data[READ_PCR_RESULT_SIZE];
> > + ssize_t len;
> > + int i, j, index, num_pcrs;
> > + char *str = buf;
> > +
> > + struct tpm_chp *chip =
> > + pci_get_drvdata(container_of(dev, struct pci_dev, dev));
>
> use to_pci_dev()
<snip>
> > + ssize_t len;
> > + __be32 *native_val;
> > + int i;
> > + char *str = buf;
> > +
> > + struct tpm_chip *chip =
> > + pci_get_drvdata(container_of(dev, struct pci_dev, dev));
>
> to_pci_dev()
<snip>
> > + ssize_t len;
> > + char *str = buf;
> > +
> > + struct tpm_chip *chip =
> > + pci_get_drvdata(container_of(dev, struct pci_dev, dev));
>
> to_pci_dev()
<snip>
The following patch changes these container_of calls to 'to_pci_dev' as
suggested above.
Signed-off-by: Kylene Hall <[email protected]>
---
--- linux-2.6.12-rc2/drivers/char/tpm/tpm.c 2005-04-26 16:45:51.000000000 -0500
+++ linux-2.6.12-rc2-tpmdd/drivers/char/tpm/tpm.c 2005-04-26 16:48:12.000000000 -0500
@@ -230,7 +230,7 @@ ssize_t tpm_show_pcrs(struct device *dev
char *str = buf;
struct tpm_chip *chip =
- pci_get_drvdata(container_of(dev, struct pci_dev, dev));
+ pci_get_drvdata(to_pci_dev(dev));
if (chip == NULL)
return -ENODEV;
@@ -273,7 +273,7 @@ ssize_t tpm_show_pubek(struct device *de
char *str = buf;
struct tpm_chip *chip =
- pci_get_drvdata(container_of(dev, struct pci_dev, dev));
+ pci_get_drvdata(to_pci_dev(dev));
if (chip == NULL)
return -ENODEV;
@@ -352,7 +352,7 @@ ssize_t tpm_show_caps(struct device *dev
char *str = buf;
struct tpm_chip *chip =
- pci_get_drvdata(container_of(dev, struct pci_dev, dev));
+ pci_get_drvdata(to_pci_dev(dev));
if (chip == NULL)
return -ENODEV;
\