diff options
| author | Jiri Slaby <jslaby@suse.cz> | 2012-04-02 07:54:32 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-04-09 14:30:39 -0400 |
| commit | e6df3cce07a25d7d65c7d3d2cec87cbf02fd21f0 (patch) | |
| tree | a9fc9e09912471e195ffc10ebeae6b2ed2c115dd /drivers/tty/ipwireless | |
| parent | de3a60a3436ebfd780ced830cd09880ea9c45957 (diff) | |
TTY: ipwireless, move prints to appropriate places
There are two functions which only print a status. Let us do that
directly at places where they are called.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Jiri Kosina <jkosina@suse.cz>
Acked-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/ipwireless')
| -rw-r--r-- | drivers/tty/ipwireless/tty.c | 31 |
1 files changed, 10 insertions, 21 deletions
diff --git a/drivers/tty/ipwireless/tty.c b/drivers/tty/ipwireless/tty.c index e5396212e22..4270bfd59a7 100644 --- a/drivers/tty/ipwireless/tty.c +++ b/drivers/tty/ipwireless/tty.c | |||
| @@ -73,23 +73,6 @@ static char *tty_type_name(int tty_type) | |||
| 73 | return channel_names[tty_type]; | 73 | return channel_names[tty_type]; |
| 74 | } | 74 | } |
| 75 | 75 | ||
| 76 | static void report_registering(struct ipw_tty *tty) | ||
| 77 | { | ||
| 78 | char *iftype = tty_type_name(tty->tty_type); | ||
| 79 | |||
| 80 | printk(KERN_INFO IPWIRELESS_PCCARD_NAME | ||
| 81 | ": registering %s device ttyIPWp%d\n", iftype, tty->index); | ||
| 82 | } | ||
| 83 | |||
| 84 | static void report_deregistering(struct ipw_tty *tty) | ||
| 85 | { | ||
| 86 | char *iftype = tty_type_name(tty->tty_type); | ||
| 87 | |||
| 88 | printk(KERN_INFO IPWIRELESS_PCCARD_NAME | ||
| 89 | ": deregistering %s device ttyIPWp%d\n", iftype, | ||
| 90 | tty->index); | ||
| 91 | } | ||
| 92 | |||
| 93 | static struct ipw_tty *get_tty(int index) | 76 | static struct ipw_tty *get_tty(int index) |
| 94 | { | 77 | { |
| 95 | /* | 78 | /* |
| @@ -500,8 +483,12 @@ static int add_tty(int j, | |||
| 500 | ipwireless_associate_network_tty(network, | 483 | ipwireless_associate_network_tty(network, |
| 501 | secondary_channel_idx, | 484 | secondary_channel_idx, |
| 502 | ttys[j]); | 485 | ttys[j]); |
| 503 | if (get_tty(j) == ttys[j]) | 486 | /* check if we provide raw device (if loopback is enabled) */ |
| 504 | report_registering(ttys[j]); | 487 | if (get_tty(j)) |
| 488 | printk(KERN_INFO IPWIRELESS_PCCARD_NAME | ||
| 489 | ": registering %s device ttyIPWp%d\n", | ||
| 490 | tty_type_name(tty_type), j); | ||
| 491 | |||
| 505 | return 0; | 492 | return 0; |
| 506 | } | 493 | } |
| 507 | 494 | ||
| @@ -560,8 +547,10 @@ void ipwireless_tty_free(struct ipw_tty *tty) | |||
| 560 | 547 | ||
| 561 | if (ttyj) { | 548 | if (ttyj) { |
| 562 | mutex_lock(&ttyj->ipw_tty_mutex); | 549 | mutex_lock(&ttyj->ipw_tty_mutex); |
| 563 | if (get_tty(j) == ttyj) | 550 | if (get_tty(j)) |
| 564 | report_deregistering(ttyj); | 551 | printk(KERN_INFO IPWIRELESS_PCCARD_NAME |
| 552 | ": deregistering %s device ttyIPWp%d\n", | ||
| 553 | tty_type_name(ttyj->tty_type), j); | ||
| 565 | ttyj->closing = 1; | 554 | ttyj->closing = 1; |
| 566 | if (ttyj->linux_tty != NULL) { | 555 | if (ttyj->linux_tty != NULL) { |
| 567 | mutex_unlock(&ttyj->ipw_tty_mutex); | 556 | mutex_unlock(&ttyj->ipw_tty_mutex); |
