diff options
author | wengjianfeng <wengjianfeng@yulong.com> | 2021-04-12 10:20:06 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-04-12 13:23:03 -0700 |
commit | a115d24a636e892ddd1ae58f8e23c78a0390cb68 (patch) | |
tree | a52dd32aa2cee8b8b6d92819cec29f9eb507f82a /drivers/nfc/pn533/i2c.c | |
parent | 5711ffd31355e17d87710e7691899409a640f58a (diff) |
nfc: pn533: remove redundant assignment
In many places,first assign a value to a variable and then return
the variable. which is redundant, we should directly return the value.
in pn533_rf_field funciton,return rc also in the if statement, so we
use return 0 to replace the last return rc.
Signed-off-by: wengjianfeng <wengjianfeng@yulong.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/nfc/pn533/i2c.c')
-rw-r--r-- | drivers/nfc/pn533/i2c.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/nfc/pn533/i2c.c b/drivers/nfc/pn533/i2c.c index 0207e66cee21..795da9b85d56 100644 --- a/drivers/nfc/pn533/i2c.c +++ b/drivers/nfc/pn533/i2c.c @@ -40,11 +40,8 @@ static int pn533_i2c_send_ack(struct pn533 *dev, gfp_t flags) struct i2c_client *client = phy->i2c_dev; static const u8 ack[6] = {0x00, 0x00, 0xff, 0x00, 0xff, 0x00}; /* spec 6.2.1.3: Preamble, SoPC (2), ACK Code (2), Postamble */ - int rc; - - rc = i2c_master_send(client, ack, 6); - return rc; + return i2c_master_send(client, ack, 6); } static int pn533_i2c_send_frame(struct pn533 *dev, @@ -199,8 +196,7 @@ static int pn533_i2c_probe(struct i2c_client *client, &phy->i2c_dev->dev); if (IS_ERR(priv)) { - r = PTR_ERR(priv); - return r; + return PTR_ERR(priv); } phy->priv = priv; |