net: devlink: introduce port registered assert helper and use it
authorJiri Pirko <jiri@nvidia.com>
Thu, 29 Sep 2022 07:28:56 +0000 (09:28 +0200)
committerJakub Kicinski <kuba@kernel.org>
Sat, 1 Oct 2022 01:17:16 +0000 (18:17 -0700)
commit3fcb698d9c773d1e0ce5eb4374273457eb4c8338
treebe5e2afae92482e1416cc78256ae3347b5bdf96c
parent3406079bbb279e33ab4b8d9a30e4dd68ce7bcafe
net: devlink: introduce port registered assert helper and use it

Instead of checking devlink_port->devlink pointer for not being NULL
which indicates that devlink port is registered, put this check to new
pair of helpers similar to what we have for devlink and use them in
other functions.

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