diff options
author | Alan Cox <alan@linux.intel.com> | 2009-09-19 16:13:22 -0400 |
---|---|---|
committer | Live-CD User <linux@linux.site> | 2009-09-19 16:13:22 -0400 |
commit | e936ffd5cb2b4c7ee04925c9b92b616c01f1e022 (patch) | |
tree | 39cd02bb0e80dcf8bca8d69319ab1638c57b6a7d /drivers/char | |
parent | 6ff1ab28a2b0a8d863c8e0d4af79a758697f6ecc (diff) |
cyclades: use the full port_close function
Convert cyclades to use the full tty_port_close helper
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/cyclades.c | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/drivers/char/cyclades.c b/drivers/char/cyclades.c index f518e0b5b47d..70bd61b2a7d7 100644 --- a/drivers/char/cyclades.c +++ b/drivers/char/cyclades.c | |||
@@ -1750,24 +1750,15 @@ static void cy_flush_buffer(struct tty_struct *tty) | |||
1750 | } /* cy_flush_buffer */ | 1750 | } /* cy_flush_buffer */ |
1751 | 1751 | ||
1752 | 1752 | ||
1753 | /* | 1753 | static void cy_do_close(struct tty_port *port) |
1754 | * This routine is called when a particular tty device is closed. | ||
1755 | */ | ||
1756 | static void cy_close(struct tty_struct *tty, struct file *filp) | ||
1757 | { | 1754 | { |
1758 | struct cyclades_port *info = tty->driver_data; | 1755 | struct cyclades_port *info = container_of(port, struct cyclades_port, |
1756 | port); | ||
1759 | struct cyclades_card *card; | 1757 | struct cyclades_card *card; |
1760 | unsigned long flags; | 1758 | unsigned long flags; |
1761 | int channel; | 1759 | int channel; |
1762 | 1760 | ||
1763 | if (!info || serial_paranoia_check(info, tty->name, "cy_close")) | ||
1764 | return; | ||
1765 | |||
1766 | card = info->card; | 1761 | card = info->card; |
1767 | |||
1768 | if (!tty_port_close_start(&info->port, tty, filp)) | ||
1769 | return; | ||
1770 | |||
1771 | channel = info->line - card->first_line; | 1762 | channel = info->line - card->first_line; |
1772 | spin_lock_irqsave(&card->card_lock, flags); | 1763 | spin_lock_irqsave(&card->card_lock, flags); |
1773 | 1764 | ||
@@ -1779,7 +1770,7 @@ static void cy_close(struct tty_struct *tty, struct file *filp) | |||
1779 | /* Waiting for on-board buffers to be empty before | 1770 | /* Waiting for on-board buffers to be empty before |
1780 | closing the port */ | 1771 | closing the port */ |
1781 | spin_unlock_irqrestore(&card->card_lock, flags); | 1772 | spin_unlock_irqrestore(&card->card_lock, flags); |
1782 | cy_wait_until_sent(tty, info->timeout); | 1773 | cy_wait_until_sent(port->tty, info->timeout); |
1783 | spin_lock_irqsave(&card->card_lock, flags); | 1774 | spin_lock_irqsave(&card->card_lock, flags); |
1784 | } | 1775 | } |
1785 | } else { | 1776 | } else { |
@@ -1801,14 +1792,19 @@ static void cy_close(struct tty_struct *tty, struct file *filp) | |||
1801 | } | 1792 | } |
1802 | #endif | 1793 | #endif |
1803 | } | 1794 | } |
1804 | |||
1805 | spin_unlock_irqrestore(&card->card_lock, flags); | 1795 | spin_unlock_irqrestore(&card->card_lock, flags); |
1806 | cy_shutdown(info, tty); | 1796 | cy_shutdown(info, port->tty); |
1807 | cy_flush_buffer(tty); | 1797 | } |
1808 | |||
1809 | tty_port_tty_set(&info->port, NULL); | ||
1810 | 1798 | ||
1811 | tty_port_close_end(&info->port, tty); | 1799 | /* |
1800 | * This routine is called when a particular tty device is closed. | ||
1801 | */ | ||
1802 | static void cy_close(struct tty_struct *tty, struct file *filp) | ||
1803 | { | ||
1804 | struct cyclades_port *info = tty->driver_data; | ||
1805 | if (!info || serial_paranoia_check(info, tty->name, "cy_close")) | ||
1806 | return; | ||
1807 | tty_port_close(&info->port, tty, filp); | ||
1812 | } /* cy_close */ | 1808 | } /* cy_close */ |
1813 | 1809 | ||
1814 | /* This routine gets called when tty_write has put something into | 1810 | /* This routine gets called when tty_write has put something into |
@@ -3113,11 +3109,13 @@ static void cyz_dtr_rts(struct tty_port *port, int raise) | |||
3113 | static const struct tty_port_operations cyy_port_ops = { | 3109 | static const struct tty_port_operations cyy_port_ops = { |
3114 | .carrier_raised = cyy_carrier_raised, | 3110 | .carrier_raised = cyy_carrier_raised, |
3115 | .dtr_rts = cyy_dtr_rts, | 3111 | .dtr_rts = cyy_dtr_rts, |
3112 | .shutdown = cy_do_close, | ||
3116 | }; | 3113 | }; |
3117 | 3114 | ||
3118 | static const struct tty_port_operations cyz_port_ops = { | 3115 | static const struct tty_port_operations cyz_port_ops = { |
3119 | .carrier_raised = cyz_carrier_raised, | 3116 | .carrier_raised = cyz_carrier_raised, |
3120 | .dtr_rts = cyz_dtr_rts, | 3117 | .dtr_rts = cyz_dtr_rts, |
3118 | .shutdown = cy_do_close, | ||
3121 | }; | 3119 | }; |
3122 | 3120 | ||
3123 | /* | 3121 | /* |