aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2009-10-06 11:06:21 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2009-12-11 18:18:04 -0500
commitd774a56d2353933cf21cc92a9d0012c7b69d09bf (patch)
treebe827c7744c4f228bcf9c219653a137b574a5e4a /drivers/char
parent64bc397914265a9ead8d73b63bb31ab3bdd25f67 (diff)
tty_port: coding style cleaning pass
Mind the hoover wire... Signed-off-by: Alan Cox <alan@linux.intel.com> Cc: Alan Stern <stern@rowland.harvard.edu> Cc: Oliver Neukum <oliver@neukum.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/tty_port.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/drivers/char/tty_port.c b/drivers/char/tty_port.c
index b22a61a4fbe5..41b314cfda47 100644
--- a/drivers/char/tty_port.c
+++ b/drivers/char/tty_port.c
@@ -199,7 +199,7 @@ EXPORT_SYMBOL(tty_port_lower_dtr_rts);
199 * management of these lines. Note that the dtr/rts raise is done each 199 * management of these lines. Note that the dtr/rts raise is done each
200 * iteration as a hangup may have previously dropped them while we wait. 200 * iteration as a hangup may have previously dropped them while we wait.
201 */ 201 */
202 202
203int tty_port_block_til_ready(struct tty_port *port, 203int tty_port_block_til_ready(struct tty_port *port,
204 struct tty_struct *tty, struct file *filp) 204 struct tty_struct *tty, struct file *filp)
205{ 205{
@@ -254,7 +254,8 @@ int tty_port_block_til_ready(struct tty_port *port,
254 tty_port_raise_dtr_rts(port); 254 tty_port_raise_dtr_rts(port);
255 255
256 prepare_to_wait(&port->open_wait, &wait, TASK_INTERRUPTIBLE); 256 prepare_to_wait(&port->open_wait, &wait, TASK_INTERRUPTIBLE);
257 /* Check for a hangup or uninitialised port. Return accordingly */ 257 /* Check for a hangup or uninitialised port.
258 Return accordingly */
258 if (tty_hung_up_p(filp) || !(port->flags & ASYNC_INITIALIZED)) { 259 if (tty_hung_up_p(filp) || !(port->flags & ASYNC_INITIALIZED)) {
259 if (port->flags & ASYNC_HUP_NOTIFY) 260 if (port->flags & ASYNC_HUP_NOTIFY)
260 retval = -EAGAIN; 261 retval = -EAGAIN;
@@ -286,11 +287,11 @@ int tty_port_block_til_ready(struct tty_port *port,
286 port->flags |= ASYNC_NORMAL_ACTIVE; 287 port->flags |= ASYNC_NORMAL_ACTIVE;
287 spin_unlock_irqrestore(&port->lock, flags); 288 spin_unlock_irqrestore(&port->lock, flags);
288 return retval; 289 return retval;
289
290} 290}
291EXPORT_SYMBOL(tty_port_block_til_ready); 291EXPORT_SYMBOL(tty_port_block_til_ready);
292 292
293int tty_port_close_start(struct tty_port *port, struct tty_struct *tty, struct file *filp) 293int tty_port_close_start(struct tty_port *port,
294 struct tty_struct *tty, struct file *filp)
294{ 295{
295 unsigned long flags; 296 unsigned long flags;
296 297
@@ -300,7 +301,7 @@ int tty_port_close_start(struct tty_port *port, struct tty_struct *tty, struct f
300 return 0; 301 return 0;
301 } 302 }
302 303
303 if( tty->count == 1 && port->count != 1) { 304 if (tty->count == 1 && port->count != 1) {
304 printk(KERN_WARNING 305 printk(KERN_WARNING
305 "tty_port_close_start: tty->count = 1 port count = %d.\n", 306 "tty_port_close_start: tty->count = 1 port count = %d.\n",
306 port->count); 307 port->count);
@@ -332,8 +333,8 @@ int tty_port_close_start(struct tty_port *port, struct tty_struct *tty, struct f
332 long timeout; 333 long timeout;
333 334
334 if (bps > 1200) 335 if (bps > 1200)
335 timeout = max_t(long, (HZ * 10 * port->drain_delay) / bps, 336 timeout = max_t(long,
336 HZ / 10); 337 (HZ * 10 * port->drain_delay) / bps, HZ / 10);
337 else 338 else
338 timeout = 2 * HZ; 339 timeout = 2 * HZ;
339 schedule_timeout_interruptible(timeout); 340 schedule_timeout_interruptible(timeout);
@@ -384,7 +385,7 @@ void tty_port_close(struct tty_port *port, struct tty_struct *tty,
384EXPORT_SYMBOL(tty_port_close); 385EXPORT_SYMBOL(tty_port_close);
385 386
386int tty_port_open(struct tty_port *port, struct tty_struct *tty, 387int tty_port_open(struct tty_port *port, struct tty_struct *tty,
387 struct file *filp) 388 struct file *filp)
388{ 389{
389 spin_lock_irq(&port->lock); 390 spin_lock_irq(&port->lock);
390 if (!tty_hung_up_p(filp)) 391 if (!tty_hung_up_p(filp))
@@ -404,10 +405,10 @@ int tty_port_open(struct tty_port *port, struct tty_struct *tty,
404 if (port->ops->activate) { 405 if (port->ops->activate) {
405 int retval = port->ops->activate(port, tty); 406 int retval = port->ops->activate(port, tty);
406 if (retval) { 407 if (retval) {
407 mutex_unlock(&port->mutex); 408 mutex_unlock(&port->mutex);
408 return retval; 409 return retval;
409 } 410 }
410 } 411 }
411 set_bit(ASYNCB_INITIALIZED, &port->flags); 412 set_bit(ASYNCB_INITIALIZED, &port->flags);
412 } 413 }
413 mutex_unlock(&port->mutex); 414 mutex_unlock(&port->mutex);