For example, allow:
ndctl list -b ndbus0
...in addition to the existing provider based method:
ndctl list -b ACPI.NFIT
...or the id based method:
ndctl list -b 0
Cc: Vishal Verma <[email protected]>
Reported-by: Dave Jiang <[email protected]>
Signed-off-by: Dan Williams <[email protected]>
---
util/filter.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/util/filter.c b/util/filter.c
index 74ab3535c98e..93d56928a3dc 100644
--- a/util/filter.c
+++ b/util/filter.c
@@ -21,8 +21,8 @@
struct ndctl_bus *util_bus_filter(struct ndctl_bus *bus, const char *ident)
{
char *end = NULL;
- const char *provider;
unsigned long bus_id, id;
+ const char *provider, *devname;
if (!ident || strcmp(ident, "all") == 0)
return bus;
@@ -32,12 +32,14 @@ struct ndctl_bus *util_bus_filter(struct ndctl_bus *bus,
const char *ident)
bus_id = ULONG_MAX;
provider = ndctl_bus_get_provider(bus);
+ devname = ndctl_bus_get_devname(bus);
id = ndctl_bus_get_id(bus);
if (bus_id < ULONG_MAX && bus_id == id)
return bus;
- if (bus_id == ULONG_MAX && strcmp(ident, provider) == 0)
+ if (bus_id == ULONG_MAX && (strcmp(ident, provider) == 0
+ || strcmp(ident, devname) == 0))
return bus;
return NULL;
_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm