Skip to content

Commit

Permalink
USB: mos7840: test and propagate set_uart_reg return value
Browse files Browse the repository at this point in the history
The test for an mos7840_set_uart_reg() error return value only works when
status is signed. propagate its error value.

Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
Cc: SL Baur <steve@xemacs.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Roel Kluin authored and Greg Kroah-Hartman committed May 2, 2008
1 parent 28ffd79 commit 87521c4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/usb/serial/mos7840.c
Original file line number Diff line number Diff line change
Expand Up @@ -1713,7 +1713,7 @@ static int mos7840_tiocmset(struct usb_serial_port *port, struct file *file,
{
struct moschip_port *mos7840_port;
unsigned int mcr;
unsigned int status;
int status;

dbg("%s - port %d", __func__, port->number);

Expand All @@ -1740,11 +1740,10 @@ static int mos7840_tiocmset(struct usb_serial_port *port, struct file *file,

mos7840_port->shadowMCR = mcr;

status = 0;
status = mos7840_set_uart_reg(port, MODEM_CONTROL_REGISTER, mcr);
if (status < 0) {
dbg("setting MODEM_CONTROL_REGISTER Failed\n");
return -1;
return status;
}

return 0;
Expand Down

0 comments on commit 87521c4

Please sign in to comment.