[PATCH umr] fix specifying device by ASIC name

Tom St Denis tom.stdenis at amd.com
Fri Dec 8 12:31:11 UTC 2017


Signed-off-by: Tom St Denis <tom.stdenis at amd.com>
---
 src/lib/discover.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lib/discover.c b/src/lib/discover.c
index e1ccea1d20e4..94d1c676718a 100644
--- a/src/lib/discover.c
+++ b/src/lib/discover.c
@@ -152,7 +152,7 @@ struct umr_asic *umr_discover_asic(struct umr_options *options)
 
 	snprintf(name, sizeof(name)-1, "/sys/kernel/debug/dri/%d/name", options->instance);
 	f = fopen(name, "r");
-	if (!f && !options->no_kernel && !options->use_pci) {
+	if (!f && options->instance >= 0 && !options->no_kernel && !options->use_pci) {
 		int found = 0;
 		if (!options->quiet) {
 			f = popen("lsmod | grep ^amdgpu", "r");
-- 
2.12.0



More information about the amd-gfx mailing list