aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2018-09-12 18:00:47 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2018-10-13 00:50:46 -0400
commit04ec1c8c7411d4bbb80d7ac93e93b2a5d2824842 (patch)
tree2a441026734c2bd16bff18a1b56731ced2e5d3ac
parente67504c5958f122944d4b9316d1cfc737027c466 (diff)
dgnc: TIOCM... won't reach ->ioctl()
bury the dead code (and ->tiocmget()/->tiocmset() are there, so I really wonder why have they kept the stuff that became unreachable with the introduction of those...) Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--drivers/staging/dgnc/dgnc_tty.c114
1 files changed, 0 insertions, 114 deletions
diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c
index f91eaa1c3b67..9accaa705820 100644
--- a/drivers/staging/dgnc/dgnc_tty.c
+++ b/drivers/staging/dgnc/dgnc_tty.c
@@ -60,10 +60,6 @@ static void dgnc_tty_unthrottle(struct tty_struct *tty);
60static void dgnc_tty_flush_chars(struct tty_struct *tty); 60static void dgnc_tty_flush_chars(struct tty_struct *tty);
61static void dgnc_tty_flush_buffer(struct tty_struct *tty); 61static void dgnc_tty_flush_buffer(struct tty_struct *tty);
62static void dgnc_tty_hangup(struct tty_struct *tty); 62static void dgnc_tty_hangup(struct tty_struct *tty);
63static int dgnc_set_modem_info(struct channel_t *ch, unsigned int command,
64 unsigned int __user *value);
65static int dgnc_get_modem_info(struct channel_t *ch,
66 unsigned int __user *value);
67static int dgnc_tty_tiocmget(struct tty_struct *tty); 63static int dgnc_tty_tiocmget(struct tty_struct *tty);
68static int dgnc_tty_tiocmset(struct tty_struct *tty, unsigned int set, 64static int dgnc_tty_tiocmset(struct tty_struct *tty, unsigned int set,
69 unsigned int clear); 65 unsigned int clear);
@@ -1701,106 +1697,6 @@ static void dgnc_tty_send_xchar(struct tty_struct *tty, char c)
1701 spin_unlock_irqrestore(&ch->ch_lock, flags); 1697 spin_unlock_irqrestore(&ch->ch_lock, flags);
1702} 1698}
1703 1699
1704/* Return modem signals to ld. */
1705static inline int dgnc_get_mstat(struct channel_t *ch)
1706{
1707 unsigned char mstat;
1708 unsigned long flags;
1709 int rc;
1710
1711 if (!ch)
1712 return -ENXIO;
1713
1714 spin_lock_irqsave(&ch->ch_lock, flags);
1715
1716 mstat = ch->ch_mostat | ch->ch_mistat;
1717
1718 spin_unlock_irqrestore(&ch->ch_lock, flags);
1719
1720 rc = 0;
1721
1722 if (mstat & UART_MCR_DTR)
1723 rc |= TIOCM_DTR;
1724 if (mstat & UART_MCR_RTS)
1725 rc |= TIOCM_RTS;
1726 if (mstat & UART_MSR_CTS)
1727 rc |= TIOCM_CTS;
1728 if (mstat & UART_MSR_DSR)
1729 rc |= TIOCM_DSR;
1730 if (mstat & UART_MSR_RI)
1731 rc |= TIOCM_RI;
1732 if (mstat & UART_MSR_DCD)
1733 rc |= TIOCM_CD;
1734
1735 return rc;
1736}
1737
1738/* Return modem signals to ld. */
1739static int dgnc_get_modem_info(struct channel_t *ch,
1740 unsigned int __user *value)
1741{
1742 return put_user(dgnc_get_mstat(ch), value);
1743}
1744
1745/* Set modem signals, called by ld. */
1746static int dgnc_set_modem_info(struct channel_t *ch,
1747 unsigned int command,
1748 unsigned int __user *value)
1749{
1750 int rc;
1751 unsigned int arg = 0;
1752 unsigned long flags;
1753
1754 rc = get_user(arg, value);
1755 if (rc)
1756 return rc;
1757
1758 switch (command) {
1759 case TIOCMBIS:
1760 if (arg & TIOCM_RTS)
1761 ch->ch_mostat |= UART_MCR_RTS;
1762
1763 if (arg & TIOCM_DTR)
1764 ch->ch_mostat |= UART_MCR_DTR;
1765
1766 break;
1767
1768 case TIOCMBIC:
1769 if (arg & TIOCM_RTS)
1770 ch->ch_mostat &= ~(UART_MCR_RTS);
1771
1772 if (arg & TIOCM_DTR)
1773 ch->ch_mostat &= ~(UART_MCR_DTR);
1774
1775 break;
1776
1777 case TIOCMSET:
1778
1779 if (arg & TIOCM_RTS)
1780 ch->ch_mostat |= UART_MCR_RTS;
1781 else
1782 ch->ch_mostat &= ~(UART_MCR_RTS);
1783
1784 if (arg & TIOCM_DTR)
1785 ch->ch_mostat |= UART_MCR_DTR;
1786 else
1787 ch->ch_mostat &= ~(UART_MCR_DTR);
1788
1789 break;
1790
1791 default:
1792 return -EINVAL;
1793 }
1794
1795 spin_lock_irqsave(&ch->ch_lock, flags);
1796
1797 ch->ch_bd->bd_ops->assert_modem_signals(ch);
1798
1799 spin_unlock_irqrestore(&ch->ch_lock, flags);
1800
1801 return 0;
1802}
1803
1804/* Ioctl to get the information for ditty. */ 1700/* Ioctl to get the information for ditty. */
1805static int dgnc_tty_digigeta(struct tty_struct *tty, 1701static int dgnc_tty_digigeta(struct tty_struct *tty,
1806 struct digi_t __user *retinfo) 1702 struct digi_t __user *retinfo)
@@ -2282,16 +2178,6 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
2282 2178
2283 return 0; 2179 return 0;
2284 2180
2285 case TIOCMGET:
2286 spin_unlock_irqrestore(&ch->ch_lock, flags);
2287 return dgnc_get_modem_info(ch, uarg);
2288
2289 case TIOCMBIS:
2290 case TIOCMBIC:
2291 case TIOCMSET:
2292 spin_unlock_irqrestore(&ch->ch_lock, flags);
2293 return dgnc_set_modem_info(ch, cmd, uarg);
2294
2295 /* Here are any additional ioctl's that we want to implement */ 2181 /* Here are any additional ioctl's that we want to implement */
2296 2182
2297 case TCFLSH: 2183 case TCFLSH: