Input: atmel_mxt_ts - simplify the return expression of mxt_send_bootloader_cmd()
authorZheng Yongjun <zhengyongjun3@huawei.com>
Fri, 11 Dec 2020 06:25:52 +0000 (22:25 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Fri, 11 Dec 2020 07:39:18 +0000 (23:39 -0800)
Simplify the return expression.

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Link: https://lore.kernel.org/r/20201210135943.1612-1-zhengyongjun3@huawei.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/touchscreen/atmel_mxt_ts.c

index dde364d..f5a86aa 100644 (file)
@@ -608,7 +608,6 @@ recheck:
 
 static int mxt_send_bootloader_cmd(struct mxt_data *data, bool unlock)
 {
-       int ret;
        u8 buf[2];
 
        if (unlock) {
@@ -619,11 +618,7 @@ static int mxt_send_bootloader_cmd(struct mxt_data *data, bool unlock)
                buf[1] = 0x01;
        }
 
-       ret = mxt_bootloader_write(data, buf, 2);
-       if (ret)
-               return ret;
-
-       return 0;
+       return mxt_bootloader_write(data, buf, sizeof(buf));
 }
 
 static int __mxt_read_reg(struct i2c_client *client,