Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 185294
b: refs/heads/master
c: f2b5cc8
h: refs/heads/master
v: v3
  • Loading branch information
Johan Hovold authored and Greg Kroah-Hartman committed Mar 2, 2010
1 parent 4e4a427 commit c93b433
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6a9b15fed4dca1f90e41ae0cfe35aaa39a20f495
refs/heads/master: f2b5cc834b69d2999b749144481de9a94f01bc48
14 changes: 11 additions & 3 deletions trunk/drivers/usb/serial/ch341.c
Original file line number Diff line number Diff line change
Expand Up @@ -392,16 +392,22 @@ static void ch341_break_ctl(struct tty_struct *tty, int break_state)
struct usb_serial_port *port = tty->driver_data;
int r;
uint16_t reg_contents;
uint8_t break_reg[2];
uint8_t *break_reg;

dbg("%s()", __func__);

break_reg = kmalloc(2, GFP_KERNEL);
if (!break_reg) {
dev_err(&port->dev, "%s - kmalloc failed\n", __func__);
return;
}

r = ch341_control_in(port->serial->dev, CH341_REQ_READ_REG,
ch341_break_reg, 0, break_reg, sizeof(break_reg));
ch341_break_reg, 0, break_reg, 2);
if (r < 0) {
dev_err(&port->dev, "%s - USB control read error (%d)\n",
__func__, r);
return;
goto out;
}
dbg("%s - initial ch341 break register contents - reg1: %x, reg2: %x",
__func__, break_reg[0], break_reg[1]);
Expand All @@ -422,6 +428,8 @@ static void ch341_break_ctl(struct tty_struct *tty, int break_state)
if (r < 0)
dev_err(&port->dev, "%s - USB control write error (%d)\n",
__func__, r);
out:
kfree(break_reg);
}

static int ch341_tiocmset(struct tty_struct *tty, struct file *file,
Expand Down

0 comments on commit c93b433

Please sign in to comment.