From: Tormod Volden Date: Fri, 1 Oct 2021 22:05:32 +0000 (+0200) Subject: Keep LIBUSB_OPTION_WEAK_AUTHORITY as a macro with same value X-Git-Tag: upstream/1.0.25~14 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;ds=sidebyside;h=33d9949921423d0911527e04af8372d320f2489b;p=platform%2Fupstream%2Flibusb.git Keep LIBUSB_OPTION_WEAK_AUTHORITY as a macro with same value If the value is always the same we retain binary compatibility. References #935 Signed-off-by: Tormod Volden Signed-off-by: Nathan Hjelm --- diff --git a/libusb/core.c b/libusb/core.c index 8ebf08b..7893ac2 100644 --- a/libusb/core.c +++ b/libusb/core.c @@ -2229,7 +2229,6 @@ int API_EXPORTED libusb_set_option(libusb_context *ctx, /* Handle all backend-specific options here */ case LIBUSB_OPTION_USE_USBDK: case LIBUSB_OPTION_NO_DEVICE_DISCOVERY: - case LIBUSB_OPTION_WEAK_AUTHORITY: if (usbi_backend.set_option) return usbi_backend.set_option(ctx, option, ap); diff --git a/libusb/libusb.h b/libusb/libusb.h index 7ec3fcf..53aeec5 100644 --- a/libusb/libusb.h +++ b/libusb/libusb.h @@ -2115,17 +2115,15 @@ enum libusb_option { * This is typically needed on Android, where access to USB devices * is limited. * + * For LIBUSB_API_VERSION 0x01000108 it was called LIBUSB_OPTION_WEAK_AUTHORITY + * * Only valid on Linux. */ LIBUSB_OPTION_NO_DEVICE_DISCOVERY = 2, - /** Flag that libusb has weak authority. - * - * (Deprecated) alias for LIBUSB_OPTION_NO_DEVICE_DISCOVERY - */ - LIBUSB_OPTION_WEAK_AUTHORITY = 3, +#define LIBUSB_OPTION_WEAK_AUTHORITY LIBUSB_OPTION_NO_DEVICE_DISCOVERY - LIBUSB_OPTION_MAX = 4 + LIBUSB_OPTION_MAX = 3 }; int LIBUSB_CALL libusb_set_option(libusb_context *ctx, enum libusb_option option, ...); diff --git a/libusb/os/linux_usbfs.c b/libusb/os/linux_usbfs.c index 1888c92..c300675 100644 --- a/libusb/os/linux_usbfs.c +++ b/libusb/os/linux_usbfs.c @@ -439,8 +439,7 @@ static int op_set_option(struct libusb_context *ctx, enum libusb_option option, UNUSED(ctx); UNUSED(ap); - if (option == LIBUSB_OPTION_NO_DEVICE_DISCOVERY || - option == LIBUSB_OPTION_WEAK_AUTHORITY) { + if (option == LIBUSB_OPTION_NO_DEVICE_DISCOVERY) { usbi_dbg(ctx, "no enumeration will be performed"); no_enumeration = 1; return LIBUSB_SUCCESS; diff --git a/libusb/version_nano.h b/libusb/version_nano.h index d5d1fd2..ff0c997 100644 --- a/libusb/version_nano.h +++ b/libusb/version_nano.h @@ -1 +1 @@ -#define LIBUSB_NANO 11676 +#define LIBUSB_NANO 11678