mirror of
https://github.com/nfc-tools/libnfc.git
synced 2026-07-20 02:31:49 +00:00
usbbus: make usb_initialized static
This commit is contained in:
@@ -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