net: devlink: let the core report the driver name instead of the drivers
authorVincent Mailhol <mailhol.vincent@wanadoo.fr>
Tue, 29 Nov 2022 09:51:38 +0000 (18:51 +0900)
committerJakub Kicinski <kuba@kernel.org>
Thu, 1 Dec 2022 05:49:38 +0000 (21:49 -0800)
commit226bf980550627c88549b112ac6c8fb40873afb4
treedfe0850bb47e635b48f1bac64e81bc548152a969
parenta933e7f05bd413bcfd5fb103ad86519526a49446
net: devlink: let the core report the driver name instead of the drivers

The driver name is available in device_driver::name. Right now,
drivers still have to report this piece of information themselves in
their devlink_ops::info_get callback function.

In order to factorize code, make devlink_nl_info_fill() add the driver
name attribute.

Now that the core sets the driver name attribute, drivers are not
supposed to call devlink_info_driver_name_put() anymore. Remove
devlink_info_driver_name_put() and clean-up all the drivers using this
function in their callback.

Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Tested-by: Ido Schimmel <idosch@nvidia.com> # mlxsw
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
22 files changed:
drivers/crypto/marvell/octeontx2/otx2_cpt_devlink.c
drivers/net/dsa/hirschmann/hellcreek.c
drivers/net/dsa/mv88e6xxx/devlink.c
drivers/net/dsa/sja1105/sja1105_devlink.c
drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth-devlink.c
drivers/net/ethernet/fungible/funeth/funeth_devlink.c
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_devlink.c
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_devlink.c
drivers/net/ethernet/intel/ice/ice_devlink.c
drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c
drivers/net/ethernet/marvell/octeontx2/nic/otx2_devlink.c
drivers/net/ethernet/marvell/prestera/prestera_devlink.c
drivers/net/ethernet/mellanox/mlx5/core/devlink.c
drivers/net/ethernet/mellanox/mlxsw/core.c
drivers/net/ethernet/netronome/nfp/nfp_devlink.c
drivers/net/ethernet/pensando/ionic/ionic_devlink.c
drivers/net/ethernet/qlogic/qed/qed_devlink.c
drivers/net/netdevsim/dev.c
drivers/ptp/ptp_ocp.c
include/net/devlink.h
net/core/devlink.c