mirror of
https://github.com/nfc-tools/libnfc.git
synced 2026-02-27 04:06:38 +00:00
usbbus: make usb_initialized static
This commit is contained in:
1
debian/libnfc4.symbols
vendored
1
debian/libnfc4.symbols
vendored
@@ -54,5 +54,4 @@ libnfc.so.4 libnfc4 #MINVER#
|
||||
str_nfc_baud_rate@Base 1.7.0~rc2
|
||||
str_nfc_modulation_type@Base 1.7.0~rc2
|
||||
str_nfc_target@Base 1.7.0~rc2
|
||||
usb_initialized@Base 1.7.0~rc6-0
|
||||
usb_prepare@Base 1.7.0~rc6-0
|
||||
|
||||
@@ -32,13 +32,12 @@
|
||||
#define LOG_CATEGORY "libnfc.buses.usbbus"
|
||||
#define LOG_GROUP NFC_LOG_GROUP_DRIVER
|
||||
|
||||
// Global flag to know if usb_init() has already been called or not
|
||||
bool usb_initialized = false;
|
||||
|
||||
int usb_prepare(void)
|
||||
{
|
||||
if (usb_initialized)
|
||||
static bool usb_initialized = false;
|
||||
if (usb_initialized) {
|
||||
return 0;
|
||||
}
|
||||
usb_init();
|
||||
usb_initialized = true;
|
||||
|
||||
|
||||
@@ -41,9 +41,6 @@
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
|
||||
// Global flag to know if usb_init() has already been called or not
|
||||
extern bool usb_initialized;
|
||||
|
||||
int usb_prepare(void);
|
||||
|
||||
#endif // __NFC_BUS_USB_H__
|
||||
|
||||
Reference in New Issue
Block a user