Make serial mandatory for sc_usb
In practice, it is already mandatory. PR #2974 <https://github.com/Genymobile/scrcpy/pull/2974>
This commit is contained in:
parent
1d6f9952ee
commit
48e3ff284f
1 changed files with 2 additions and 4 deletions
|
@ -43,10 +43,6 @@ accept_device(libusb_device *device, const char *serial) {
|
|||
|
||||
static libusb_device *
|
||||
sc_usb_find_device(const char *serial) {
|
||||
if (!serial) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
libusb_device **list;
|
||||
libusb_device *result = NULL;
|
||||
ssize_t count = libusb_get_device_list(NULL, &list);
|
||||
|
@ -81,6 +77,8 @@ sc_usb_open_handle(libusb_device *device) {
|
|||
|
||||
bool
|
||||
sc_usb_init(struct sc_usb *usb, const char *serial) {
|
||||
assert(serial);
|
||||
|
||||
// There is only one device, initialize the context here
|
||||
if (libusb_init(&usb->context) != LIBUSB_SUCCESS) {
|
||||
return false;
|
||||
|
|
Loading…
Reference in a new issue