From 27420fec40e22cb3ff04bcef654110eb2ef37620 Mon Sep 17 00:00:00 2001 From: Christophe Ricard Date: Sat, 30 Apr 2016 09:12:39 +0200 Subject: nfc: st-nci: set is_ese_present and is_uicc_present properly When they're present, set is_ese_present and set is_uicc_present to the value describe in their package description. So far is_ese_present and is_uicc_present was set to true if their property was present. Signed-off-by: Christophe Ricard Signed-off-by: Samuel Ortiz --- drivers/nfc/st-nci/spi.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'drivers/nfc/st-nci/spi.c') diff --git a/drivers/nfc/st-nci/spi.c b/drivers/nfc/st-nci/spi.c index e015015c5dc9..51a863f0a987 100644 --- a/drivers/nfc/st-nci/spi.c +++ b/drivers/nfc/st-nci/spi.c @@ -229,6 +229,7 @@ static int st_nci_spi_acpi_request_resources(struct spi_device *spi_dev) const struct acpi_device_id *id; struct gpio_desc *gpiod_reset; struct device *dev; + u8 tmp; if (!spi_dev) return -EINVAL; @@ -252,10 +253,18 @@ static int st_nci_spi_acpi_request_resources(struct spi_device *spi_dev) phy->irq_polarity = irq_get_trigger_type(spi_dev->irq); - phy->se_status.is_ese_present = - device_property_present(dev, "ese-present"); - phy->se_status.is_uicc_present = - device_property_present(dev, "uicc-present"); + phy->se_status.is_ese_present = false; + phy->se_status.is_uicc_present = false; + + if (device_property_present(dev, "ese-present")) { + device_property_read_u8(dev, "ese-present", &tmp); + tmp = phy->se_status.is_ese_present; + } + + if (device_property_present(dev, "uicc-present")) { + device_property_read_u8(dev, "uicc-present", &tmp); + tmp = phy->se_status.is_uicc_present; + } return 0; } -- cgit v1.2.3