Modifying the code so that when "all" option is passed in, we will process
all the DIMMs on the platform.

Signed-off-by: Dave Jiang <dave.ji...@intel.com>
---
 ndctl/update.c |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/ndctl/update.c b/ndctl/update.c
index fc26acf..4fb572d 100644
--- a/ndctl/update.c
+++ b/ndctl/update.c
@@ -471,16 +471,22 @@ static int get_ndctl_dimm(struct update_context *uctx, 
void *ctx)
 {
        struct ndctl_dimm *dimm;
        struct ndctl_bus *bus;
+       int rc = -ENODEV;
 
        ndctl_bus_foreach(ctx, bus)
                ndctl_dimm_foreach(bus, dimm) {
                        if (!util_dimm_filter(dimm, uctx->dimm_id))
                                continue;
                        uctx->dimm = dimm;
-                       return 0;
+                       rc = update_firmware(uctx);
+                       if (rc < 0) {
+                               error("Update firmware for dimm %s failed\n",
+                                               ndctl_dimm_get_devname(dimm));
+                               continue;
+                       }
                }
 
-       return -ENODEV;
+       return rc;
 }
 
 static int verify_fw_file(struct update_context *uctx)
@@ -579,12 +585,6 @@ int cmd_update_firmware(int argc, const char **argv, void 
*ctx)
                return rc;
        }
 
-       rc = update_firmware(&uctx);
-       if (rc < 0) {
-               error("Update firmware failed");
-               return rc;
-       }
-
        if (uctx.start)
                ndctl_cmd_unref(uctx.start);
 

_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

Reply via email to