diff mbox series

[net-next,3/4] netdevsim: expose version of default flash target

Message ID 20220818130042.535762-4-jiri@resnulli.us (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series net: devlink: sync flash and dev info commands | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Series has a cover letter
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit fail Errors and warnings before: 92 this patch: 92
netdev/cc_maintainers success CCed 5 of 5 maintainers
netdev/build_clang fail Errors and warnings before: 8 this patch: 8
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn fail Errors and warnings before: 92 this patch: 92
netdev/checkpatch warning WARNING: line length of 88 exceeds 80 columns
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Jiri Pirko Aug. 18, 2022, 1 p.m. UTC
From: Jiri Pirko <jiri@nvidia.com>

Add version named "fw" to represent version of default flash target.

Example:

$ devlink dev info
netdevsim/netdevsim10:
  driver netdevsim
  versions:
      running:
        fw.mgmt 10.20.30
        fw 11.22.33
      flash_components:
        fw.mgmt

Signed-off-by: Jiri Pirko <jiri@nvidia.com>
---
 drivers/net/netdevsim/dev.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/netdevsim/dev.c b/drivers/net/netdevsim/dev.c
index cea130490dea..97281b6aa41f 100644
--- a/drivers/net/netdevsim/dev.c
+++ b/drivers/net/netdevsim/dev.c
@@ -990,8 +990,12 @@  static int nsim_dev_info_get(struct devlink *devlink,
 	if (err)
 		return err;
 
-	return devlink_info_version_running_put_ext(req, "fw.mgmt", "10.20.30",
-						    DEVLINK_INFO_VERSION_TYPE_COMPONENT);
+	err = devlink_info_version_running_put_ext(req, "fw.mgmt", "10.20.30",
+						   DEVLINK_INFO_VERSION_TYPE_COMPONENT);
+	if (err)
+		return err;
+
+	return devlink_info_version_running_put(req, "fw", "11.22.33");
 }
 
 #define NSIM_DEV_FLASH_SIZE 500000