Commit 9d4d51cc authored by Stephen Hemminger's avatar Stephen Hemminger

[IRDA]: Get rid of useless hashbin in irtty.

Working on converting IRDA to new netdevice semantics, this is the first
of some of the small things I found.

The irtty hashbin is created, maintained and never used.
Motivation for removing is that the hashbin locking has problems with
the locking assumptions in on network device removal.
parent b5062521
...@@ -39,7 +39,6 @@ ...@@ -39,7 +39,6 @@
#include <net/irda/wrapper.h> #include <net/irda/wrapper.h>
#include <net/irda/irda_device.h> #include <net/irda/irda_device.h>
static hashbin_t *irtty = NULL;
static struct tty_ldisc irda_ldisc; static struct tty_ldisc irda_ldisc;
static int qos_mtt_bits = 0x03; /* 5 ms or more */ static int qos_mtt_bits = 0x03; /* 5 ms or more */
...@@ -75,14 +74,6 @@ int __init irtty_init(void) ...@@ -75,14 +74,6 @@ int __init irtty_init(void)
{ {
int status; int status;
/* Probably no need to lock here because all operations done in
* open()/close() which are already safe - Jean II */
irtty = hashbin_new( HB_NOLOCK);
if ( irtty == NULL) {
printk( KERN_WARNING "IrDA: Can't allocate irtty hashbin!\n");
return -ENOMEM;
}
/* Fill in our line protocol discipline, and register it */ /* Fill in our line protocol discipline, and register it */
memset(&irda_ldisc, 0, sizeof( irda_ldisc)); memset(&irda_ldisc, 0, sizeof( irda_ldisc));
...@@ -124,12 +115,6 @@ static void __exit irtty_cleanup(void) ...@@ -124,12 +115,6 @@ static void __exit irtty_cleanup(void)
__FUNCTION__, ret); __FUNCTION__, ret);
} }
/*
* The TTY should care of deallocating the instances by using the
* callback to irtty_close(), therefore we do give any deallocation
* function to hashbin_destroy().
*/
hashbin_delete(irtty, NULL);
} }
/* /*
...@@ -172,8 +157,6 @@ static int irtty_open(struct tty_struct *tty) ...@@ -172,8 +157,6 @@ static int irtty_open(struct tty_struct *tty)
/* Give self a name */ /* Give self a name */
strcpy(name, tty->name); strcpy(name, tty->name);
hashbin_insert(irtty, (irda_queue_t *) self, (int) self, NULL);
if (tty->driver->flush_buffer) if (tty->driver->flush_buffer)
tty->driver->flush_buffer(tty); tty->driver->flush_buffer(tty);
...@@ -285,8 +268,6 @@ static void irtty_close(struct tty_struct *tty) ...@@ -285,8 +268,6 @@ static void irtty_close(struct tty_struct *tty)
if (self->netdev) if (self->netdev)
unregister_netdev(self->netdev); unregister_netdev(self->netdev);
self = hashbin_remove(irtty, (int) self, NULL);
/* Protect access to self->task and self->?x_buff - Jean II */ /* Protect access to self->task and self->?x_buff - Jean II */
spin_lock_irqsave(&self->lock, flags); spin_lock_irqsave(&self->lock, flags);
......
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <net/irda/irda.h> #include <net/irda/irda.h>
#include <net/irda/irqueue.h>
#include <net/irda/irda_device.h> #include <net/irda/irda_device.h>
/* Used by ioctl */ /* Used by ioctl */
...@@ -45,7 +44,6 @@ struct irtty_info { ...@@ -45,7 +44,6 @@ struct irtty_info {
#define IRTTY_IOC_MAXNR 2 #define IRTTY_IOC_MAXNR 2
struct irtty_cb { struct irtty_cb {
irda_queue_t q; /* Must be first */
magic_t magic; magic_t magic;
struct net_device *netdev; /* Yes! we are some kind of netdevice */ struct net_device *netdev; /* Yes! we are some kind of netdevice */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment