2013-03-04 19:00:10

by Jason Gunthorpe

[permalink] [raw]
Subject: Re: [tpmdd-devel] [PATCH v2] tpm: Add support for new Infineon I2C TPM (SLB 9645 TT 1.2 I2C)

On Mon, Mar 04, 2013 at 11:41:04AM -0600, Kent Yoder wrote:
> > .id_table = tpm_tis_i2c_table,
> > .probe = tpm_tis_i2c_probe,
> > .remove = tpm_tis_i2c_remove,
> > @@ -703,11 +759,12 @@ static struct i2c_driver tpm_tis_i2c_driver = {
> > .name = "tpm_i2c_infineon",
> > .owner = THIS_MODULE,
> > .pm = &tpm_tis_i2c_ops,
> > + .of_match_table = of_match_ptr(tpm_tis_i2c_of_match),
>
> Please put this line inside an ifdef CONFIG_OF, since of_match_ptr
> lives in there.

The OF stuff is designed to hide the CONFIG_OF from using code,
of_match_ptr(x) expends to NULL when CONFIG_OF is not set.

It is optional to include the MATCH_TABLE bit in a CONFI_OF #ifdef,
lots of places don't.

Jason