From: Jiri Pirko Date: Wed, 24 Aug 2022 12:20:10 +0000 (+0200) Subject: netdevsim: add version fw.mgmt info info_get() and mark as a component X-Git-Tag: v6.1-rc1~170^2~340^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0c1989754f76b52bd30581ff543890cab8c75a9d;p=thirdparty%2Flinux.git netdevsim: add version fw.mgmt info info_get() and mark as a component Fix the only component user which is netdevsim. It uses component named "fw.mgmt" in selftests. So add this version to info_get() output with version type component. Signed-off-by: Jiri Pirko Signed-off-by: Jakub Kicinski --- diff --git a/drivers/net/netdevsim/dev.c b/drivers/net/netdevsim/dev.c index e88f783c297eb..d6938faf6c8ba 100644 --- a/drivers/net/netdevsim/dev.c +++ b/drivers/net/netdevsim/dev.c @@ -984,7 +984,17 @@ static int nsim_dev_info_get(struct devlink *devlink, struct devlink_info_req *req, struct netlink_ext_ack *extack) { - return devlink_info_driver_name_put(req, DRV_NAME); + int err; + + err = devlink_info_driver_name_put(req, DRV_NAME); + if (err) + return err; + err = devlink_info_version_stored_put_ext(req, "fw.mgmt", "10.20.30", + DEVLINK_INFO_VERSION_TYPE_COMPONENT); + if (err) + return err; + return devlink_info_version_running_put_ext(req, "fw.mgmt", "10.20.30", + DEVLINK_INFO_VERSION_TYPE_COMPONENT); } #define NSIM_DEV_FLASH_SIZE 500000