devlink: don't require setting features before registration
authorJakub Kicinski <kuba@kernel.org>
Fri, 6 Jan 2023 06:33:59 +0000 (22:33 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 6 Jan 2023 12:56:19 +0000 (12:56 +0000)
Requiring devlink_set_features() to be run before devlink is
registered is overzealous. devlink_set_features() itself is
a leftover from old workarounds which were trying to prevent
initiating reload before probe was complete.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/devlink/core.c

index 7cf0b3e..a31a317 100644 (file)
@@ -125,8 +125,6 @@ next:
  */
 void devlink_set_features(struct devlink *devlink, u64 features)
 {
-       ASSERT_DEVLINK_NOT_REGISTERED(devlink);
-
        WARN_ON(features & DEVLINK_F_RELOAD &&
                !devlink_reload_supported(devlink->ops));
        devlink->features = features;