diff options
author | Colin Ian King <colin.king@canonical.com> | 2015-01-19 08:32:58 -0500 |
---|---|---|
committer | Johan Hovold <johan@kernel.org> | 2015-01-19 09:58:16 -0500 |
commit | 3e264ffc831e70c4a3ecc8c2eeb5bfbc1c8a30d3 (patch) | |
tree | 9de8c12e3a14e63bae8cf52b6ea13bda4d49026a | |
parent | 46dc0fc4befac07e71621d122a72194d2ae61c36 (diff) |
USB: mos7840: remove unused code
There is old, unused code that is #defined out by the use of NOTMOS7840
and NOTMCS7840 - these are not defined anywhere.
If NOTMOS7840 is defined then the code will break on null pointer
dereferences on mos7840_port. So the code is currently unused, and
broken anyway, so why not just remove it.
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
-rw-r--r-- | drivers/usb/serial/mos7840.c | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c index 220b4be89641..e4473a9109cf 100644 --- a/drivers/usb/serial/mos7840.c +++ b/drivers/usb/serial/mos7840.c | |||
@@ -1309,35 +1309,6 @@ static int mos7840_write(struct tty_struct *tty, struct usb_serial_port *port, | |||
1309 | const unsigned char *current_position = data; | 1309 | const unsigned char *current_position = data; |
1310 | unsigned char *data1; | 1310 | unsigned char *data1; |
1311 | 1311 | ||
1312 | #ifdef NOTMOS7840 | ||
1313 | Data = 0x00; | ||
1314 | status = mos7840_get_uart_reg(port, LINE_CONTROL_REGISTER, &Data); | ||
1315 | mos7840_port->shadowLCR = Data; | ||
1316 | dev_dbg(&port->dev, "%s: LINE_CONTROL_REGISTER is %x\n", __func__, Data); | ||
1317 | dev_dbg(&port->dev, "%s: mos7840_port->shadowLCR is %x\n", __func__, mos7840_port->shadowLCR); | ||
1318 | |||
1319 | /* Data = 0x03; */ | ||
1320 | /* status = mos7840_set_uart_reg(port,LINE_CONTROL_REGISTER,Data); */ | ||
1321 | /* mos7840_port->shadowLCR=Data;//Need to add later */ | ||
1322 | |||
1323 | Data |= SERIAL_LCR_DLAB; /* data latch enable in LCR 0x80 */ | ||
1324 | status = mos7840_set_uart_reg(port, LINE_CONTROL_REGISTER, Data); | ||
1325 | |||
1326 | /* Data = 0x0c; */ | ||
1327 | /* status = mos7840_set_uart_reg(port,DIVISOR_LATCH_LSB,Data); */ | ||
1328 | Data = 0x00; | ||
1329 | status = mos7840_get_uart_reg(port, DIVISOR_LATCH_LSB, &Data); | ||
1330 | dev_dbg(&port->dev, "%s: DLL value is %x\n", __func__, Data); | ||
1331 | |||
1332 | Data = 0x0; | ||
1333 | status = mos7840_get_uart_reg(port, DIVISOR_LATCH_MSB, &Data); | ||
1334 | dev_dbg(&port->dev, "%s: DLM value is %x\n", __func__, Data); | ||
1335 | |||
1336 | Data = Data & ~SERIAL_LCR_DLAB; | ||
1337 | dev_dbg(&port->dev, "%s: mos7840_port->shadowLCR is %x\n", __func__, mos7840_port->shadowLCR); | ||
1338 | status = mos7840_set_uart_reg(port, LINE_CONTROL_REGISTER, Data); | ||
1339 | #endif | ||
1340 | |||
1341 | if (mos7840_port_paranoia_check(port, __func__)) | 1312 | if (mos7840_port_paranoia_check(port, __func__)) |
1342 | return -1; | 1313 | return -1; |
1343 | 1314 | ||
@@ -1614,37 +1585,6 @@ static int mos7840_calc_baud_rate_divisor(struct usb_serial_port *port, | |||
1614 | *clk_sel_val = 0x70; | 1585 | *clk_sel_val = 0x70; |
1615 | } | 1586 | } |
1616 | return 0; | 1587 | return 0; |
1617 | |||
1618 | #ifdef NOTMCS7840 | ||
1619 | |||
1620 | for (i = 0; i < ARRAY_SIZE(mos7840_divisor_table); i++) { | ||
1621 | if (mos7840_divisor_table[i].BaudRate == baudrate) { | ||
1622 | *divisor = mos7840_divisor_table[i].Divisor; | ||
1623 | return 0; | ||
1624 | } | ||
1625 | } | ||
1626 | |||
1627 | /* After trying for all the standard baud rates * | ||
1628 | * Try calculating the divisor for this baud rate */ | ||
1629 | |||
1630 | if (baudrate > 75 && baudrate < 230400) { | ||
1631 | /* get the divisor */ | ||
1632 | custom = (__u16) (230400L / baudrate); | ||
1633 | |||
1634 | /* Check for round off */ | ||
1635 | round1 = (__u16) (2304000L / baudrate); | ||
1636 | round = (__u16) (round1 - (custom * 10)); | ||
1637 | if (round > 4) | ||
1638 | custom++; | ||
1639 | *divisor = custom; | ||
1640 | |||
1641 | dev_dbg(&port->dev, " Baud %d = %d\n", baudrate, custom); | ||
1642 | return 0; | ||
1643 | } | ||
1644 | |||
1645 | dev_dbg(&port->dev, "%s", " Baud calculation Failed...\n"); | ||
1646 | return -1; | ||
1647 | #endif | ||
1648 | } | 1588 | } |
1649 | 1589 | ||
1650 | /***************************************************************************** | 1590 | /***************************************************************************** |