usb: device: update logging module registration

Update logging module registration and remove LOG_LEVEL macro
for USB device classes.

Signed-off-by: Witold Lukasik <witold.lukasik@nordicsemi.no>
This commit is contained in:
Witold Lukasik 2022-12-08 16:42:37 +01:00 committed by Carles Cufí
commit c7acd98bf4
15 changed files with 15 additions and 30 deletions

View file

@ -4,9 +4,8 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
#define LOG_LEVEL CONFIG_USB_DEVICE_LOG_LEVEL
#include <zephyr/logging/log.h> #include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(usb_bos); LOG_MODULE_REGISTER(usb_bos, CONFIG_USB_DEVICE_LOG_LEVEL);
#include <zephyr/kernel.h> #include <zephyr/kernel.h>

View file

@ -21,9 +21,8 @@
#include <zephyr/drivers/bluetooth/hci_driver.h> #include <zephyr/drivers/bluetooth/hci_driver.h>
#include <zephyr/sys/atomic.h> #include <zephyr/sys/atomic.h>
#define LOG_LEVEL CONFIG_USB_DEVICE_LOG_LEVEL
#include <zephyr/logging/log.h> #include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(usb_bluetooth); LOG_MODULE_REGISTER(usb_bluetooth, CONFIG_USB_DEVICE_LOG_LEVEL);
#define USB_RF_SUBCLASS 0x01 #define USB_RF_SUBCLASS 0x01
#define USB_BLUETOOTH_PROTOCOL 0x01 #define USB_BLUETOOTH_PROTOCOL 0x01

View file

@ -18,9 +18,8 @@
#include <zephyr/bluetooth/hci_raw.h> #include <zephyr/bluetooth/hci_raw.h>
#include <zephyr/bluetooth/l2cap.h> #include <zephyr/bluetooth/l2cap.h>
#define LOG_LEVEL CONFIG_USB_DEVICE_LOG_LEVEL
#include <zephyr/logging/log.h> #include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(usb_bt_h4); LOG_MODULE_REGISTER(usb_bt_h4, CONFIG_USB_DEVICE_LOG_LEVEL);
static K_FIFO_DEFINE(rx_queue); static K_FIFO_DEFINE(rx_queue);
static K_FIFO_DEFINE(tx_queue); static K_FIFO_DEFINE(tx_queue);

View file

@ -55,9 +55,8 @@
/* definitions */ /* definitions */
#define LOG_LEVEL CONFIG_USB_CDC_ACM_LOG_LEVEL
#include <zephyr/logging/log.h> #include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(usb_cdc_acm); LOG_MODULE_REGISTER(usb_cdc_acm, CONFIG_USB_CDC_ACM_LOG_LEVEL);
/* 115200bps, no parity, 1 stop bit, 8bit char */ /* 115200bps, no parity, 1 stop bit, 8bit char */
#define CDC_ACM_DEFAULT_BAUDRATE {sys_cpu_to_le32(115200), 0, 0, 8} #define CDC_ACM_DEFAULT_BAUDRATE {sys_cpu_to_le32(115200), 0, 0, 8}

View file

@ -53,9 +53,8 @@
#include <usb_descriptor.h> #include <usb_descriptor.h>
#include <usb_work_q.h> #include <usb_work_q.h>
#define LOG_LEVEL CONFIG_USB_DEVICE_LOG_LEVEL
#include <zephyr/logging/log.h> #include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(usb_dfu); LOG_MODULE_REGISTER(usb_dfu, CONFIG_USB_DEVICE_LOG_LEVEL);
#define SLOT0_PARTITION slot0_partition #define SLOT0_PARTITION slot0_partition
#define SLOT1_PARTITION slot1_partition #define SLOT1_PARTITION slot1_partition

View file

@ -7,9 +7,8 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
#define LOG_LEVEL CONFIG_USB_HID_LOG_LEVEL
#include <zephyr/logging/log.h> #include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(usb_hid); LOG_MODULE_REGISTER(usb_hid, CONFIG_USB_HID_LOG_LEVEL);
#include <zephyr/sys/byteorder.h> #include <zephyr/sys/byteorder.h>
#include <usb_device.h> #include <usb_device.h>

View file

@ -12,9 +12,8 @@
#include <zephyr/usb/usb_device.h> #include <zephyr/usb/usb_device.h>
#include <usb_descriptor.h> #include <usb_descriptor.h>
#define LOG_LEVEL CONFIG_USB_DEVICE_LOG_LEVEL
#include <zephyr/logging/log.h> #include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(usb_loopback); LOG_MODULE_REGISTER(usb_loopback, CONFIG_USB_DEVICE_LOG_LEVEL);
#define LOOPBACK_OUT_EP_ADDR 0x01 #define LOOPBACK_OUT_EP_ADDR 0x01
#define LOOPBACK_IN_EP_ADDR 0x81 #define LOOPBACK_IN_EP_ADDR 0x81

View file

@ -43,9 +43,8 @@
#include <zephyr/usb/usb_device.h> #include <zephyr/usb/usb_device.h>
#include <usb_descriptor.h> #include <usb_descriptor.h>
#define LOG_LEVEL CONFIG_USB_MASS_STORAGE_LOG_LEVEL
#include <zephyr/logging/log.h> #include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(usb_msc); LOG_MODULE_REGISTER(usb_msc, CONFIG_USB_MASS_STORAGE_LOG_LEVEL);
/* max USB packet size */ /* max USB packet size */
#define MAX_PACKET CONFIG_MASS_STORAGE_BULK_EP_MPS #define MAX_PACKET CONFIG_MASS_STORAGE_BULK_EP_MPS

View file

@ -4,9 +4,8 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
#define LOG_LEVEL CONFIG_USB_DEVICE_NETWORK_LOG_LEVEL
#include <zephyr/logging/log.h> #include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(usb_ecm); LOG_MODULE_REGISTER(usb_ecm, CONFIG_USB_DEVICE_NETWORK_LOG_LEVEL);
/* Enable verbose debug printing extra hexdumps */ /* Enable verbose debug printing extra hexdumps */
#define VERBOSE_DEBUG 0 #define VERBOSE_DEBUG 0

View file

@ -4,9 +4,8 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
#define LOG_LEVEL CONFIG_USB_DEVICE_NETWORK_LOG_LEVEL
#include <zephyr/logging/log.h> #include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(usb_eem); LOG_MODULE_REGISTER(usb_eem, CONFIG_USB_DEVICE_NETWORK_LOG_LEVEL);
#include <zephyr/net/net_pkt.h> #include <zephyr/net/net_pkt.h>
#include <zephyr/net/ethernet.h> #include <zephyr/net/ethernet.h>

View file

@ -4,9 +4,8 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
#define LOG_LEVEL CONFIG_USB_DEVICE_NETWORK_LOG_LEVEL
#include <zephyr/logging/log.h> #include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(usb_rndis); LOG_MODULE_REGISTER(usb_rndis, CONFIG_USB_DEVICE_NETWORK_LOG_LEVEL);
/* Enable verbose debug printing extra hexdumps */ /* Enable verbose debug printing extra hexdumps */
#define VERBOSE_DEBUG 0 #define VERBOSE_DEBUG 0

View file

@ -6,9 +6,8 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
#define LOG_LEVEL CONFIG_USB_DEVICE_NETWORK_LOG_LEVEL
#include <zephyr/logging/log.h> #include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(usb_net); LOG_MODULE_REGISTER(usb_net, CONFIG_USB_DEVICE_NETWORK_LOG_LEVEL);
#include <zephyr/init.h> #include <zephyr/init.h>

View file

@ -4,9 +4,8 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
#define LOG_LEVEL CONFIG_USB_DEVICE_LOG_LEVEL
#include <zephyr/logging/log.h> #include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(usb_os_desc); LOG_MODULE_REGISTER(usb_os_desc, CONFIG_USB_DEVICE_LOG_LEVEL);
#include <zephyr/kernel.h> #include <zephyr/kernel.h>

View file

@ -14,9 +14,8 @@
#include "usb_descriptor.h" #include "usb_descriptor.h"
#include <zephyr/drivers/hwinfo.h> #include <zephyr/drivers/hwinfo.h>
#define LOG_LEVEL CONFIG_USB_DEVICE_LOG_LEVEL
#include <zephyr/logging/log.h> #include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(usb_descriptor); LOG_MODULE_REGISTER(usb_descriptor, CONFIG_USB_DEVICE_LOG_LEVEL);
/* /*
* The last index of the initializer_string without null character is: * The last index of the initializer_string without null character is:

View file

@ -68,9 +68,8 @@
#include <usb_descriptor.h> #include <usb_descriptor.h>
#include <zephyr/usb/class/usb_audio.h> #include <zephyr/usb/class/usb_audio.h>
#define LOG_LEVEL CONFIG_USB_DEVICE_LOG_LEVEL
#include <zephyr/logging/log.h> #include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(usb_device); LOG_MODULE_REGISTER(usb_device, CONFIG_USB_DEVICE_LOG_LEVEL);
#include <zephyr/usb/bos.h> #include <zephyr/usb/bos.h>
#include <os_desc.h> #include <os_desc.h>