Commit 471f894f authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller

net: devlink: export devlink net getter

Allow drivers to get net struct for devlink instance.
Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b7a59557
...@@ -771,6 +771,7 @@ static inline struct devlink *netdev_to_devlink(struct net_device *dev) ...@@ -771,6 +771,7 @@ static inline struct devlink *netdev_to_devlink(struct net_device *dev)
struct ib_device; struct ib_device;
struct net *devlink_net(const struct devlink *devlink);
struct devlink *devlink_alloc(const struct devlink_ops *ops, size_t priv_size); struct devlink *devlink_alloc(const struct devlink_ops *ops, size_t priv_size);
int devlink_register(struct devlink *devlink, struct device *dev); int devlink_register(struct devlink *devlink, struct device *dev);
void devlink_unregister(struct devlink *devlink); void devlink_unregister(struct devlink *devlink);
......
...@@ -95,10 +95,11 @@ static LIST_HEAD(devlink_list); ...@@ -95,10 +95,11 @@ static LIST_HEAD(devlink_list);
*/ */
static DEFINE_MUTEX(devlink_mutex); static DEFINE_MUTEX(devlink_mutex);
static struct net *devlink_net(const struct devlink *devlink) struct net *devlink_net(const struct devlink *devlink)
{ {
return read_pnet(&devlink->_net); return read_pnet(&devlink->_net);
} }
EXPORT_SYMBOL_GPL(devlink_net);
static void devlink_net_set(struct devlink *devlink, struct net *net) static void devlink_net_set(struct devlink *devlink, struct net *net)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment