|
@@ -199,6 +199,7 @@ static const struct tpm_tis_phy_ops tpm_spi_phy_ops = {
|
|
|
static int tpm_tis_spi_probe(struct spi_device *dev)
|
|
|
{
|
|
|
struct tpm_tis_spi_phy *phy;
|
|
|
+ int irq;
|
|
|
|
|
|
phy = devm_kzalloc(&dev->dev, sizeof(struct tpm_tis_spi_phy),
|
|
|
GFP_KERNEL);
|
|
@@ -211,7 +212,13 @@ static int tpm_tis_spi_probe(struct spi_device *dev)
|
|
|
if (!phy->iobuf)
|
|
|
return -ENOMEM;
|
|
|
|
|
|
- return tpm_tis_core_init(&dev->dev, &phy->priv, -1, &tpm_spi_phy_ops,
|
|
|
+ /* If the SPI device has an IRQ then use that */
|
|
|
+ if (dev->irq > 0)
|
|
|
+ irq = dev->irq;
|
|
|
+ else
|
|
|
+ irq = -1;
|
|
|
+
|
|
|
+ return tpm_tis_core_init(&dev->dev, &phy->priv, irq, &tpm_spi_phy_ops,
|
|
|
NULL);
|
|
|
}
|
|
|
|