Skip to contentSkip to conversation

nfc: s3fwrn5: use signed integer for parsing GPIO numbers

PATCH New Krzysztof Kozlowski 1 participant 1 message Nov 23, 2020

Subsystems (5)
lore
Share & tools
lore

Krzysztof Kozlowski

author maintainer
#0 lore raw

PATCH 1/1 nfc: s3fwrn5: use signed integer for parsing GPIO numbers

GPIOs - as returned by of_get_named_gpio() and used by the gpiolib - are signed integers, where negative number indicates error. The return value of of_get_named_gpio() should not be assigned to an unsigned int because in case of !CONFIG_GPIOLIB such number would be a valid GPIO.

Fixes c04c674fadeb ("nfc: s3fwrn5: Add driver for Samsung S3FWRN5 NFC Chip")
---
 drivers/nfc/s3fwrn5/i2c.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/nfc/s3fwrn5/i2c.c +2 -2
index 0ffa389066a0..ae26594c7302 100644
@@ -25,8 +25,8 @@ struct s3fwrn5_i2c_phy {
 	struct i2c_client *i2c_dev;
 	struct nci_dev *ndev;
 
-	unsigned int gpio_en;
-	unsigned int gpio_fw_wake;
+	int gpio_en;
+	int gpio_fw_wake;
 
 	struct mutex mutex;
 
Signature · 1 line
2.25.1