[net-next] dummy: declare dummy devices as enumerated devices

Message ID 1505179965-12117-1-git-send-email-zhangshengju@cmss.chinamobile.com
State Accepted
Delegated to: David Miller
Headers show
Series
  • [net-next] dummy: declare dummy devices as enumerated devices
Related show

Commit Message

Zhang Shengju Sept. 12, 2017, 1:32 a.m.
Dummy device name is enumerated by the kernel, let user space be aware
of the naming scheme used by dummy devices:
(visible in /sys/class/net/<iface>/name_assign_type).

Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
---
 drivers/net/dummy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Miller Sept. 18, 2017, 6:29 p.m. | #1
From: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
Date: Tue, 12 Sep 2017 09:32:45 +0800

> Dummy device name is enumerated by the kernel, let user space be aware
> of the naming scheme used by dummy devices:
> (visible in /sys/class/net/<iface>/name_assign_type).
> 
> Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>

Applied.

Patch

diff --git a/drivers/net/dummy.c b/drivers/net/dummy.c
index d0a1f9c..e31ab3b 100644
--- a/drivers/net/dummy.c
+++ b/drivers/net/dummy.c
@@ -388,7 +388,7 @@  static int __init dummy_init_one(void)
 	int err;
 
 	dev_dummy = alloc_netdev(sizeof(struct dummy_priv),
-				 "dummy%d", NET_NAME_UNKNOWN, dummy_setup);
+				 "dummy%d", NET_NAME_ENUM, dummy_setup);
 	if (!dev_dummy)
 		return -ENOMEM;