Browse Source

fpgautils: Don't try to scan serial at all anymore, if a device is claimed

Luke Dashjr 13 years ago
parent
commit
2448cd4c28
1 changed files with 8 additions and 0 deletions
  1. 8 0
      fpgautils.c

+ 8 - 0
fpgautils.c

@@ -206,6 +206,8 @@ int serial_autodetect_ftdi(__maybe_unused detectone_func_t detectone, __maybe_un
 }
 #endif
 
+struct device_api *serial_claim(const char *devpath, struct device_api *api);
+
 int
 _serial_detect(const char*dname, detectone_func_t detectone, autoscan_func_t autoscan, int flags)
 {
@@ -237,6 +239,12 @@ _serial_detect(const char*dname, detectone_func_t detectone, autoscan_func_t aut
 		if ((flags & 2) && !hasname)
 			continue;
 		else
+		if (serial_claim(s, NULL))
+		{
+			applog(LOG_DEBUG, "%s is already claimed... skipping probes", s);
+			string_elist_del(iter);
+		}
+		else
 		if (detectone(s)) {
 			string_elist_del(iter);
 			inhibitauto = true;