Patchwork pktgen: use proc_create_data()

login
register
mail settings
Submitter Alexey Dobriyan
Date Aug. 28, 2009, 7:47 p.m.
Message ID <20090828194721.GD14499@x200.localdomain>
Download mbox | patch
Permalink /patch/32436/
State Accepted
Delegated to: David Miller
Headers show

Comments

Alexey Dobriyan - Aug. 28, 2009, 7:47 p.m.
It looks like after rename device proc entry is unusable,
because of no ->read_proc or ->proc_fops.

And create_proc_entry() is deprecated.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

 net/core/pktgen.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller - Aug. 29, 2009, 6:34 a.m.
From: Alexey Dobriyan <adobriyan@gmail.com>
Date: Fri, 28 Aug 2009 23:47:21 +0400

> It looks like after rename device proc entry is unusable,
> because of no ->read_proc or ->proc_fops.
> 
> And create_proc_entry() is deprecated.
> 
> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>

Applied, thanks Alexey.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -1873,8 +1873,10 @@  static void pktgen_change_name(struct net_device *dev)
 
 			remove_proc_entry(pkt_dev->entry->name, pg_proc_dir);
 
-			pkt_dev->entry = create_proc_entry(dev->name, 0600,
-							   pg_proc_dir);
+			pkt_dev->entry = proc_create_data(dev->name, 0600,
+							  pg_proc_dir,
+							  &pktgen_if_fops,
+							  pkt_dev);
 			if (!pkt_dev->entry)
 				printk(KERN_ERR "pktgen: can't move proc "
 				       " entry for '%s'\n", dev->name);