uni-t-ut32x: drop redundant close and free at end of scan

The UT32x driver requires a user spec for the connection. The device
cannot get identified, that's why successful open/close for the port
will suffice. Lack of an input spec as well as failure in the early
scan phase will terminate the scan routine early.

When we reach the end of the scan which creates the device instance
and registers it with the list of found devices, the port already
is closed and the list of devices will never be empty. Remove the
redundant close call and the dead branch which frees the serial port.
This commit is contained in:
Gerhard Sittig 2019-12-14 09:27:15 +01:00 committed by Uwe Hermann
parent ff5fb18526
commit 00f3c94386
1 changed files with 0 additions and 4 deletions

View File

@ -114,10 +114,6 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
}
devices = g_slist_append(devices, sdi);
serial_close(serial);
if (!devices)
sr_serial_dev_inst_free(serial);
return std_scan_complete(di, devices);
}