]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
Simplify show-regs
authorKeith Busch <keith.busch@intel.com>
Thu, 3 Mar 2016 20:20:16 +0000 (13:20 -0700)
committerKeith Busch <keith.busch@intel.com>
Fri, 4 Mar 2016 22:37:21 +0000 (15:37 -0700)
You only need to specify the name of the device. The character or block
device was never necessary to show the registers since we're opening the
sysfs resource entry. This is backwards compatibles with the old way as
the basename was stripped from the path before.

Signed-off-by: Keith Busch <keith.busch@intel.com>
nvme.c

diff --git a/nvme.c b/nvme.c
index fbf5ada390e63032da14928ad8975f2f171f0061..560b92000c8de0a9f5af17c5cbcf3b5170b1bfb7 100644 (file)
--- a/nvme.c
+++ b/nvme.c
@@ -1239,7 +1239,7 @@ static int show_registers(int argc, char **argv)
 
        while ((opt = getopt_long(argc, (char **)argv, "", NULL,
                                        &long_index)) != -1);
-       get_dev(argc, argv);
+       devicename = basename(argv[optind]);
 
        get_registers(&bar);
        printf("cap     : ");