]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/irda/irlap.c
[CONNECTOR]: clean up {,__}cn_rx_skb()
[linux-2.6-omap-h63xx.git] / net / irda / irlap.c
index d93ebd11431e86b2c82f65fc220e7e1316abfc50..f3236acc8d22e2706e5d1a643c085598cc982352 100644 (file)
@@ -95,7 +95,7 @@ int __init irlap_init(void)
        return 0;
 }
 
-void __exit irlap_cleanup(void)
+void irlap_cleanup(void)
 {
        IRDA_ASSERT(irlap != NULL, return;);
 
@@ -1210,7 +1210,7 @@ static int irlap_seq_show(struct seq_file *seq, void *v)
        return 0;
 }
 
-static struct seq_operations irlap_seq_ops = {
+static const struct seq_operations irlap_seq_ops = {
        .start  = irlap_seq_start,
        .next   = irlap_seq_next,
        .stop   = irlap_seq_stop,
@@ -1219,29 +1219,11 @@ static struct seq_operations irlap_seq_ops = {
 
 static int irlap_seq_open(struct inode *inode, struct file *file)
 {
-       struct seq_file *seq;
-       int rc = -ENOMEM;
-       struct irlap_iter_state *s = kzalloc(sizeof(*s), GFP_KERNEL);
+       if (irlap == NULL)
+               return -EINVAL;
 
-       if (!s)
-               goto out;
-
-       if (irlap == NULL) {
-               rc = -EINVAL;
-               goto out_kfree;
-       }
-
-       rc = seq_open(file, &irlap_seq_ops);
-       if (rc)
-               goto out_kfree;
-
-       seq          = file->private_data;
-       seq->private = s;
-out:
-       return rc;
-out_kfree:
-       kfree(s);
-       goto out;
+       return seq_open_private(file, &irlap_seq_ops,
+                       sizeof(struct irlap_iter_state));
 }
 
 const struct file_operations irlap_seq_fops = {