Commit 6e6fbb72 authored by Jakub Kicinski's avatar Jakub Kicinski

Merge branch 'net-devlink-couple-of-trivial-fixes'

Jiri Pirko says:

====================
net: devlink: couple of trivial fixes

Just a couple of trivial fixes I found on the way.
====================

Link: https://lore.kernel.org/r/20220713141853.2992014-1-jiri@resnulli.usSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents 816cd168 a44c4511
...@@ -1266,10 +1266,8 @@ int mlxsw_sp_dpipe_init(struct mlxsw_sp *mlxsw_sp) ...@@ -1266,10 +1266,8 @@ int mlxsw_sp_dpipe_init(struct mlxsw_sp *mlxsw_sp)
struct devlink *devlink = priv_to_devlink(mlxsw_sp->core); struct devlink *devlink = priv_to_devlink(mlxsw_sp->core);
int err; int err;
err = devlink_dpipe_headers_register(devlink, devlink_dpipe_headers_register(devlink, &mlxsw_sp_dpipe_headers);
&mlxsw_sp_dpipe_headers);
if (err)
return err;
err = mlxsw_sp_dpipe_erif_table_init(mlxsw_sp); err = mlxsw_sp_dpipe_erif_table_init(mlxsw_sp);
if (err) if (err)
goto err_erif_table_init; goto err_erif_table_init;
......
...@@ -1590,7 +1590,7 @@ int devlink_dpipe_table_register(struct devlink *devlink, ...@@ -1590,7 +1590,7 @@ int devlink_dpipe_table_register(struct devlink *devlink,
void *priv, bool counter_control_extern); void *priv, bool counter_control_extern);
void devlink_dpipe_table_unregister(struct devlink *devlink, void devlink_dpipe_table_unregister(struct devlink *devlink,
const char *table_name); const char *table_name);
int devlink_dpipe_headers_register(struct devlink *devlink, void devlink_dpipe_headers_register(struct devlink *devlink,
struct devlink_dpipe_headers *dpipe_headers); struct devlink_dpipe_headers *dpipe_headers);
void devlink_dpipe_headers_unregister(struct devlink *devlink); void devlink_dpipe_headers_unregister(struct devlink *devlink);
bool devlink_dpipe_table_counter_enabled(struct devlink *devlink, bool devlink_dpipe_table_counter_enabled(struct devlink *devlink,
......
...@@ -1700,9 +1700,9 @@ static int devlink_nl_cmd_port_unsplit_doit(struct sk_buff *skb, ...@@ -1700,9 +1700,9 @@ static int devlink_nl_cmd_port_unsplit_doit(struct sk_buff *skb,
return devlink->ops->port_unsplit(devlink, devlink_port, info->extack); return devlink->ops->port_unsplit(devlink, devlink_port, info->extack);
} }
static int devlink_port_new_notifiy(struct devlink *devlink, static int devlink_port_new_notify(struct devlink *devlink,
unsigned int port_index, unsigned int port_index,
struct genl_info *info) struct genl_info *info)
{ {
struct devlink_port *devlink_port; struct devlink_port *devlink_port;
struct sk_buff *msg; struct sk_buff *msg;
...@@ -1724,8 +1724,7 @@ static int devlink_port_new_notifiy(struct devlink *devlink, ...@@ -1724,8 +1724,7 @@ static int devlink_port_new_notifiy(struct devlink *devlink,
if (err) if (err)
goto out; goto out;
err = genlmsg_reply(msg, info); return genlmsg_reply(msg, info);
return err;
out: out:
nlmsg_free(msg); nlmsg_free(msg);
...@@ -1775,7 +1774,7 @@ static int devlink_nl_cmd_port_new_doit(struct sk_buff *skb, ...@@ -1775,7 +1774,7 @@ static int devlink_nl_cmd_port_new_doit(struct sk_buff *skb,
if (err) if (err)
return err; return err;
err = devlink_port_new_notifiy(devlink, new_port_index, info); err = devlink_port_new_notify(devlink, new_port_index, info);
if (err && err != -ENODEV) { if (err && err != -ENODEV) {
/* Fail to send the response; destroy newly created port. */ /* Fail to send the response; destroy newly created port. */
devlink->ops->port_del(devlink, new_port_index, extack); devlink->ops->port_del(devlink, new_port_index, extack);
...@@ -10425,13 +10424,12 @@ EXPORT_SYMBOL_GPL(devlink_sb_unregister); ...@@ -10425,13 +10424,12 @@ EXPORT_SYMBOL_GPL(devlink_sb_unregister);
* *
* Register the headers supported by hardware. * Register the headers supported by hardware.
*/ */
int devlink_dpipe_headers_register(struct devlink *devlink, void devlink_dpipe_headers_register(struct devlink *devlink,
struct devlink_dpipe_headers *dpipe_headers) struct devlink_dpipe_headers *dpipe_headers)
{ {
devl_lock(devlink); devl_lock(devlink);
devlink->dpipe_headers = dpipe_headers; devlink->dpipe_headers = dpipe_headers;
devl_unlock(devlink); devl_unlock(devlink);
return 0;
} }
EXPORT_SYMBOL_GPL(devlink_dpipe_headers_register); EXPORT_SYMBOL_GPL(devlink_dpipe_headers_register);
......
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