net: devlink: disallow port_attrs_set() to be called before register
authorJiri Pirko <jiri@mellanox.com>
Sun, 24 Mar 2019 10:14:33 +0000 (11:14 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sun, 24 Mar 2019 18:55:31 +0000 (14:55 -0400)
commit45b861120e0c2694cabf082c63b022465ac572bb
tree27ca12de04f592893947116998ce8cbf169cc3b1
parentd8ba36204cc74c727f6653abc47310d513634e2e
net: devlink: disallow port_attrs_set() to be called before register

Since the port attributes are static and cannot change during the port
lifetime, WARN_ON if some driver calls it after registration. Also, no
need to call notifications as it is noop anyway due to check of
devlink_port->registered there.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/devlink.c