mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2026-01-27 12:47:24 +01:00
dcb: Use rtnl_register_many().
We will remove rtnl_register() in favour of rtnl_register_many(). When it succeeds, rtnl_register_many() guarantees all rtnetlink types in the passed array are supported, and there is no chance that a part of message types is not supported. Let's use rtnl_register_many() instead. Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com> Reviewed-by: Eric Dumazet <edumazet@google.com> Link: https://patch.msgid.link/20241014201828.91221-10-kuniyu@amazon.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
3ac84e31b3
commit
c82b031dcb
|
|
@ -2408,6 +2408,11 @@ static struct notifier_block dcbnl_nb __read_mostly = {
|
||||||
.notifier_call = dcbnl_netdevice_event,
|
.notifier_call = dcbnl_netdevice_event,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static const struct rtnl_msg_handler dcbnl_rtnl_msg_handlers[] __initconst = {
|
||||||
|
{.msgtype = RTM_GETDCB, .doit = dcb_doit},
|
||||||
|
{.msgtype = RTM_SETDCB, .doit = dcb_doit},
|
||||||
|
};
|
||||||
|
|
||||||
static int __init dcbnl_init(void)
|
static int __init dcbnl_init(void)
|
||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
|
|
@ -2416,8 +2421,7 @@ static int __init dcbnl_init(void)
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
rtnl_register(PF_UNSPEC, RTM_GETDCB, dcb_doit, NULL, 0);
|
rtnl_register_many(dcbnl_rtnl_msg_handlers);
|
||||||
rtnl_register(PF_UNSPEC, RTM_SETDCB, dcb_doit, NULL, 0);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user