Skip to content

Commit

Permalink
nfc: s3fwrn5: use signed integer for parsing GPIO numbers
Browse files Browse the repository at this point in the history
[ Upstream commit d8f0a86795c69f5b697f7d9e5274c124da93c92d ]

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: c04c674 ("nfc: s3fwrn5: Add driver for Samsung S3FWRN5 NFC Chip")
Signed-off-by: Krzysztof Kozlowski <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
  • Loading branch information
krzk authored and toraidl committed Mar 28, 2024
1 parent ab8f026 commit 225b49d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/nfc/s3fwrn5/i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,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;

Expand Down

0 comments on commit 225b49d

Please sign in to comment.