Lines Matching refs:r
94 int r; in ch341_control_out() local
99 r = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), request, in ch341_control_out()
103 return r; in ch341_control_out()
110 int r; in ch341_control_in() local
116 r = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), request, in ch341_control_in()
119 return r; in ch341_control_in()
126 int r; in ch341_set_baudrate() local
147 r = ch341_control_out(dev, 0x9a, 0x1312, a); in ch341_set_baudrate()
148 if (!r) in ch341_set_baudrate()
149 r = ch341_control_out(dev, 0x9a, 0x0f2c, b); in ch341_set_baudrate()
151 return r; in ch341_set_baudrate()
162 int r; in ch341_get_status() local
170 r = ch341_control_in(dev, 0x95, 0x0706, 0, buffer, size); in ch341_get_status()
171 if (r < 0) in ch341_get_status()
175 if (r == 2) { in ch341_get_status()
176 r = 0; in ch341_get_status()
181 r = -EPROTO; in ch341_get_status()
184 return r; in ch341_get_status()
192 int r; in ch341_configure() local
200 r = ch341_control_in(dev, 0x5f, 0, 0, buffer, size); in ch341_configure()
201 if (r < 0) in ch341_configure()
204 r = ch341_control_out(dev, 0xa1, 0, 0); in ch341_configure()
205 if (r < 0) in ch341_configure()
208 r = ch341_set_baudrate(dev, priv); in ch341_configure()
209 if (r < 0) in ch341_configure()
213 r = ch341_control_in(dev, 0x95, 0x2518, 0, buffer, size); in ch341_configure()
214 if (r < 0) in ch341_configure()
217 r = ch341_control_out(dev, 0x9a, 0x2518, 0x0050); in ch341_configure()
218 if (r < 0) in ch341_configure()
222 r = ch341_get_status(dev, priv); in ch341_configure()
223 if (r < 0) in ch341_configure()
226 r = ch341_control_out(dev, 0xa1, 0x501f, 0xd90a); in ch341_configure()
227 if (r < 0) in ch341_configure()
230 r = ch341_set_baudrate(dev, priv); in ch341_configure()
231 if (r < 0) in ch341_configure()
234 r = ch341_set_handshake(dev, priv->line_control); in ch341_configure()
235 if (r < 0) in ch341_configure()
239 r = ch341_get_status(dev, priv); in ch341_configure()
242 return r; in ch341_configure()
248 int r; in ch341_port_probe() local
258 r = ch341_configure(port->serial->dev, priv); in ch341_port_probe()
259 if (r < 0) in ch341_port_probe()
266 return r; in ch341_port_probe()
314 int r; in ch341_open() local
316 r = ch341_configure(serial->dev, priv); in ch341_open()
317 if (r) in ch341_open()
324 r = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL); in ch341_open()
325 if (r) { in ch341_open()
327 __func__, r); in ch341_open()
331 r = usb_serial_generic_open(tty, port); in ch341_open()
333 out: return r; in ch341_open()
375 int r; in ch341_break_ctl() local
383 r = ch341_control_in(port->serial->dev, CH341_REQ_READ_REG, in ch341_break_ctl()
385 if (r < 0) { in ch341_break_ctl()
387 __func__, r); in ch341_break_ctl()
404 r = ch341_control_out(port->serial->dev, CH341_REQ_WRITE_REG, in ch341_break_ctl()
406 if (r < 0) in ch341_break_ctl()
408 __func__, r); in ch341_break_ctl()