[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201209092917.20681-1-zhengyongjun3@huawei.com>
Date: Wed, 9 Dec 2020 17:29:17 +0800
From: Zheng Yongjun <zhengyongjun3@...wei.com>
To: <johan@...nel.org>, <gregkh@...uxfoundation.org>,
<linux-usb@...r.kernel.org>, <linux-kernel@...r.kernel.org>
CC: Zheng Yongjun <zhengyongjun3@...wei.com>
Subject: [PATCH -next] usb: serial: simplify the ark3116_write_reg()
Simplify the return expression.
Signed-off-by: Zheng Yongjun <zhengyongjun3@...wei.com>
---
drivers/usb/serial/ark3116.c | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/drivers/usb/serial/ark3116.c b/drivers/usb/serial/ark3116.c
index 71a9206ea1e2..0f9fa0e7c50e 100644
--- a/drivers/usb/serial/ark3116.c
+++ b/drivers/usb/serial/ark3116.c
@@ -77,16 +77,11 @@ struct ark3116_private {
static int ark3116_write_reg(struct usb_serial *serial,
unsigned reg, __u8 val)
{
- int result;
/* 0xfe 0x40 are magic values taken from original driver */
- result = usb_control_msg(serial->dev,
- usb_sndctrlpipe(serial->dev, 0),
- 0xfe, 0x40, val, reg,
- NULL, 0, ARK_TIMEOUT);
- if (result)
- return result;
-
- return 0;
+ return usb_control_msg(serial->dev,
+ usb_sndctrlpipe(serial->dev, 0),
+ 0xfe, 0x40, val, reg,
+ NULL, 0, ARK_TIMEOUT);
}
static int ark3116_read_reg(struct usb_serial *serial,
--
2.22.0
Powered by blists - more mailing lists