summaryrefslogtreecommitdiffstats
path: root/drivers/nfc/trf7970a.c
diff options
context:
space:
mode:
authorMark Greer <mgreer@animalcreek.com>2017-04-26 00:43:51 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2017-06-18 23:57:58 +0200
commitafcb9fbdba71cd39daefaff1e288472565df6af2 (patch)
tree0585ae4e5533a8bbbc0133279219a2e7594f1d30 /drivers/nfc/trf7970a.c
parentNFC: trf7970a: Fix inaccurate comment in trf7970a_probe() (diff)
downloadlinux-afcb9fbdba71cd39daefaff1e288472565df6af2.tar.xz
linux-afcb9fbdba71cd39daefaff1e288472565df6af2.zip
NFC: trf7970a: Only check 'en2-rf-quirk' if EN2 is specified
The quirk indicated by the 'en2-rf-quirk' device tree property is only relevant when there is a GPIO connected to the EN2 pin of the trf7970a. This means we should only check for 'en2-rf-quirk' when EN2 is specified in the 'ti,enable-gpios' property of the device tree. Signed-off-by: Mark Greer <mgreer@animalcreek.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/nfc/trf7970a.c')
-rw-r--r--drivers/nfc/trf7970a.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/nfc/trf7970a.c b/drivers/nfc/trf7970a.c
index 5d5a8b0e57d4..4655680b0e7b 100644
--- a/drivers/nfc/trf7970a.c
+++ b/drivers/nfc/trf7970a.c
@@ -2070,6 +2070,9 @@ static int trf7970a_probe(struct spi_device *spi)
dev_err(trf->dev, "Can't request EN2 GPIO: %d\n", ret);
return ret;
}
+
+ if (of_property_read_bool(np, "en2-rf-quirk"))
+ trf->quirks |= TRF7970A_QUIRK_EN2_MUST_STAY_LOW;
}
of_property_read_u32(np, "clock-frequency", &clk_freq);
@@ -2081,9 +2084,6 @@ static int trf7970a_probe(struct spi_device *spi)
return -EINVAL;
}
- if (of_property_read_bool(np, "en2-rf-quirk"))
- trf->quirks |= TRF7970A_QUIRK_EN2_MUST_STAY_LOW;
-
ret = devm_request_threaded_irq(trf->dev, spi->irq, NULL,
trf7970a_irq, IRQF_TRIGGER_RISING | IRQF_ONESHOT,
"trf7970a", trf);