diff options
| author | Felix Gu <ustc.gu@gmail.com> | 2026-02-21 01:20:32 +0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2026-04-02 16:29:20 +0200 |
| commit | f485ae8e9a251b7698f04270b9226fa05135fc43 (patch) | |
| tree | a16a47f5f98c7ee2d26c0b89559b1a79cd72c087 /drivers/misc | |
| parent | 84664e43ef87413f81b779b6433f43e14bc558cb (diff) | |
| download | linux-next-f485ae8e9a251b7698f04270b9226fa05135fc43.tar.gz linux-next-f485ae8e9a251b7698f04270b9226fa05135fc43.zip | |
misc: ti_fpc202: remove dead code in fpc202_detach_addr()
val is assigned from addr_caches, which is a u8 array. So the check will
never be true.
Found by code review, compile pass.
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
Reviewed-by: Romain Gantois <romain.gantois@bootlin.com>
Link: https://patch.msgid.link/20260221-fp202-v1-2-4d28cb8b28fb@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc')
| -rw-r--r-- | drivers/misc/ti_fpc202.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/drivers/misc/ti_fpc202.c b/drivers/misc/ti_fpc202.c index 578feefb77f1..79a029d79f7a 100644 --- a/drivers/misc/ti_fpc202.c +++ b/drivers/misc/ti_fpc202.c @@ -243,23 +243,15 @@ static void fpc202_detach_addr(struct i2c_atr *atr, u32 chan_id, u16 addr) { struct fpc202_priv *priv = i2c_atr_get_driver_data(atr); - int dev_num, reg_mod, val; + int dev_num, val; for (dev_num = 0; dev_num < 2; dev_num++) { - reg_mod = FPC202_REG_MOD_DEV(chan_id, dev_num); - mutex_lock(&priv->reg_dev_lock); val = priv->addr_caches[chan_id][dev_num]; mutex_unlock(&priv->reg_dev_lock); - if (val < 0) { - dev_err(&priv->client->dev, "failed to read register 0x%x while detaching address 0x%02x\n", - reg_mod, addr); - return; - } - if (val == (addr & 0x7f)) { fpc202_write_dev_addr(priv, chan_id, dev_num, FPC202_REG_DEV_INVALID); return; |
