dev_get_by_name example

From: Ran Shalit
Date: Sun Mar 08 2015 - 09:04:08 EST


Hello,

How should we use dev_get_by_name ?
What should be the 1st parameter should it be a pointer ? (without
allocation required) ?
struct net_device *dev_get_by_name(struct net *net, const char *name);
I get an exception when using it for unallocated pointer in 1st
argument, but succeeded with the following:
ndev = dev_get_by_name(&init_net, "eth0");
Is it alloweed to use init_net ?

Regards,
Ran
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/