Skip to content

Commit

Permalink
NFC: trf7970a: Only check 'en2-rf-quirk' if EN2 is specified
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mark Greer authored and Samuel Ortiz committed Jun 18, 2017
1 parent 69f984f commit afcb9fb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/nfc/trf7970a.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit afcb9fb

Please sign in to comment.