aboutsummaryrefslogtreecommitdiffstats
path: root/net/irda/irlap.c
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@openvz.org>2007-10-10 05:30:45 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:55:35 -0400
commita662d4cb50d3976d2c9c9bac34119d0036e31d21 (patch)
treee232a83f4711fff91ae6d1296c76ebb3cb44f113 /net/irda/irlap.c
parent31164088d72e1420e53f742b6c0c06f7343551dc (diff)
[IRDA]: Make the IRDA use the seq_open_private()
Just switch to the consolidated code Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/irda/irlap.c')
-rw-r--r--net/irda/irlap.c26
1 files changed, 4 insertions, 22 deletions
diff --git a/net/irda/irlap.c b/net/irda/irlap.c
index 3d76aafdb2e5..f3236acc8d22 100644
--- a/net/irda/irlap.c
+++ b/net/irda/irlap.c
@@ -1219,29 +1219,11 @@ static const struct seq_operations irlap_seq_ops = {
1219 1219
1220static int irlap_seq_open(struct inode *inode, struct file *file) 1220static int irlap_seq_open(struct inode *inode, struct file *file)
1221{ 1221{
1222 struct seq_file *seq; 1222 if (irlap == NULL)
1223 int rc = -ENOMEM; 1223 return -EINVAL;
1224 struct irlap_iter_state *s = kzalloc(sizeof(*s), GFP_KERNEL);
1225 1224
1226 if (!s) 1225 return seq_open_private(file, &irlap_seq_ops,
1227 goto out; 1226 sizeof(struct irlap_iter_state));
1228
1229 if (irlap == NULL) {
1230 rc = -EINVAL;
1231 goto out_kfree;
1232 }
1233
1234 rc = seq_open(file, &irlap_seq_ops);
1235 if (rc)
1236 goto out_kfree;
1237
1238 seq = file->private_data;
1239 seq->private = s;
1240out:
1241 return rc;
1242out_kfree:
1243 kfree(s);
1244 goto out;
1245} 1227}
1246 1228
1247const struct file_operations irlap_seq_fops = { 1229const struct file_operations irlap_seq_fops = {