Loading drivers/bus/mhi/devices/mhi_uci.c +19 −18 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.*/ /* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.*/ #include <linux/cdev.h> #include <linux/device.h> Loading Loading @@ -50,6 +50,7 @@ struct uci_dev { bool enabled; u32 tiocm; void *ipc_log; enum MHI_DEBUG_LEVEL *ipc_log_lvl; }; struct mhi_uci_drv { Loading @@ -64,36 +65,33 @@ enum MHI_DEBUG_LEVEL msg_lvl = MHI_MSG_LVL_ERROR; #ifdef CONFIG_MHI_DEBUG #define IPC_LOG_LVL (MHI_MSG_LVL_VERBOSE) #define MHI_UCI_IPC_LOG_PAGES (25) #else #define IPC_LOG_LVL (MHI_MSG_LVL_ERROR) #define MHI_UCI_IPC_LOG_PAGES (1) #endif #ifdef CONFIG_MHI_DEBUG #define MSG_VERB(fmt, ...) do { \ if (msg_lvl <= MHI_MSG_LVL_VERBOSE) \ pr_err("[D][%s] " fmt, __func__, ##__VA_ARGS__); \ if (uci_dev->ipc_log && (IPC_LOG_LVL <= MHI_MSG_LVL_VERBOSE)) \ ipc_log_string(uci_dev->ipc_log, "[D][%s] " fmt, \ __func__, ##__VA_ARGS__); \ if (uci_dev->ipc_log && uci_dev->ipc_log_lvl && \ (*uci_dev->ipc_log_lvl <= MHI_MSG_LVL_VERBOSE)) \ ipc_log_string(uci_dev->ipc_log, \ "[D][%s] " fmt, __func__, ##__VA_ARGS__); \ } while (0) #else #define MSG_VERB(fmt, ...) #define MHI_UCI_IPC_LOG_PAGES (1) #define MSG_VERB(fmt, ...) do { \ if (uci_dev->ipc_log && uci_dev->ipc_log_lvl && \ (*uci_dev->ipc_log_lvl <= MHI_MSG_LVL_VERBOSE)) \ ipc_log_string(uci_dev->ipc_log, \ "[D][%s] " fmt, __func__, ##__VA_ARGS__); \ } while (0) #endif #define MSG_LOG(fmt, ...) do { \ if (msg_lvl <= MHI_MSG_LVL_INFO) \ pr_err("[I][%s] " fmt, __func__, ##__VA_ARGS__); \ if (uci_dev->ipc_log && (IPC_LOG_LVL <= MHI_MSG_LVL_INFO)) \ if (uci_dev->ipc_log && uci_dev->ipc_log_lvl && \ (*uci_dev->ipc_log_lvl <= MHI_MSG_LVL_INFO)) \ ipc_log_string(uci_dev->ipc_log, "[I][%s] " fmt, \ __func__, ##__VA_ARGS__); \ } while (0) Loading @@ -101,7 +99,8 @@ enum MHI_DEBUG_LEVEL msg_lvl = MHI_MSG_LVL_ERROR; #define MSG_ERR(fmt, ...) do { \ if (msg_lvl <= MHI_MSG_LVL_ERROR) \ pr_err("[E][%s] " fmt, __func__, ##__VA_ARGS__); \ if (uci_dev->ipc_log && (IPC_LOG_LVL <= MHI_MSG_LVL_ERROR)) \ if (uci_dev->ipc_log && uci_dev->ipc_log_lvl && \ (*uci_dev->ipc_log_lvl <= MHI_MSG_LVL_ERROR)) \ ipc_log_string(uci_dev->ipc_log, "[E][%s] " fmt, \ __func__, ##__VA_ARGS__); \ } while (0) Loading Loading @@ -571,6 +570,7 @@ static int mhi_uci_probe(struct mhi_device *mhi_dev, const struct mhi_device_id *id) { struct uci_dev *uci_dev; struct mhi_controller *mhi_cntrl = mhi_dev->mhi_cntrl; int minor; char node_name[32]; int dir; Loading Loading @@ -606,6 +606,7 @@ static int mhi_uci_probe(struct mhi_device *mhi_dev, mhi_dev->ul_chan_id); uci_dev->ipc_log = ipc_log_context_create(MHI_UCI_IPC_LOG_PAGES, node_name, 0); uci_dev->ipc_log_lvl = &mhi_cntrl->log_lvl; for (dir = 0; dir < 2; dir++) { struct uci_chan *uci_chan = (dir) ? Loading Loading
drivers/bus/mhi/devices/mhi_uci.c +19 −18 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.*/ /* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.*/ #include <linux/cdev.h> #include <linux/device.h> Loading Loading @@ -50,6 +50,7 @@ struct uci_dev { bool enabled; u32 tiocm; void *ipc_log; enum MHI_DEBUG_LEVEL *ipc_log_lvl; }; struct mhi_uci_drv { Loading @@ -64,36 +65,33 @@ enum MHI_DEBUG_LEVEL msg_lvl = MHI_MSG_LVL_ERROR; #ifdef CONFIG_MHI_DEBUG #define IPC_LOG_LVL (MHI_MSG_LVL_VERBOSE) #define MHI_UCI_IPC_LOG_PAGES (25) #else #define IPC_LOG_LVL (MHI_MSG_LVL_ERROR) #define MHI_UCI_IPC_LOG_PAGES (1) #endif #ifdef CONFIG_MHI_DEBUG #define MSG_VERB(fmt, ...) do { \ if (msg_lvl <= MHI_MSG_LVL_VERBOSE) \ pr_err("[D][%s] " fmt, __func__, ##__VA_ARGS__); \ if (uci_dev->ipc_log && (IPC_LOG_LVL <= MHI_MSG_LVL_VERBOSE)) \ ipc_log_string(uci_dev->ipc_log, "[D][%s] " fmt, \ __func__, ##__VA_ARGS__); \ if (uci_dev->ipc_log && uci_dev->ipc_log_lvl && \ (*uci_dev->ipc_log_lvl <= MHI_MSG_LVL_VERBOSE)) \ ipc_log_string(uci_dev->ipc_log, \ "[D][%s] " fmt, __func__, ##__VA_ARGS__); \ } while (0) #else #define MSG_VERB(fmt, ...) #define MHI_UCI_IPC_LOG_PAGES (1) #define MSG_VERB(fmt, ...) do { \ if (uci_dev->ipc_log && uci_dev->ipc_log_lvl && \ (*uci_dev->ipc_log_lvl <= MHI_MSG_LVL_VERBOSE)) \ ipc_log_string(uci_dev->ipc_log, \ "[D][%s] " fmt, __func__, ##__VA_ARGS__); \ } while (0) #endif #define MSG_LOG(fmt, ...) do { \ if (msg_lvl <= MHI_MSG_LVL_INFO) \ pr_err("[I][%s] " fmt, __func__, ##__VA_ARGS__); \ if (uci_dev->ipc_log && (IPC_LOG_LVL <= MHI_MSG_LVL_INFO)) \ if (uci_dev->ipc_log && uci_dev->ipc_log_lvl && \ (*uci_dev->ipc_log_lvl <= MHI_MSG_LVL_INFO)) \ ipc_log_string(uci_dev->ipc_log, "[I][%s] " fmt, \ __func__, ##__VA_ARGS__); \ } while (0) Loading @@ -101,7 +99,8 @@ enum MHI_DEBUG_LEVEL msg_lvl = MHI_MSG_LVL_ERROR; #define MSG_ERR(fmt, ...) do { \ if (msg_lvl <= MHI_MSG_LVL_ERROR) \ pr_err("[E][%s] " fmt, __func__, ##__VA_ARGS__); \ if (uci_dev->ipc_log && (IPC_LOG_LVL <= MHI_MSG_LVL_ERROR)) \ if (uci_dev->ipc_log && uci_dev->ipc_log_lvl && \ (*uci_dev->ipc_log_lvl <= MHI_MSG_LVL_ERROR)) \ ipc_log_string(uci_dev->ipc_log, "[E][%s] " fmt, \ __func__, ##__VA_ARGS__); \ } while (0) Loading Loading @@ -571,6 +570,7 @@ static int mhi_uci_probe(struct mhi_device *mhi_dev, const struct mhi_device_id *id) { struct uci_dev *uci_dev; struct mhi_controller *mhi_cntrl = mhi_dev->mhi_cntrl; int minor; char node_name[32]; int dir; Loading Loading @@ -606,6 +606,7 @@ static int mhi_uci_probe(struct mhi_device *mhi_dev, mhi_dev->ul_chan_id); uci_dev->ipc_log = ipc_log_context_create(MHI_UCI_IPC_LOG_PAGES, node_name, 0); uci_dev->ipc_log_lvl = &mhi_cntrl->log_lvl; for (dir = 0; dir < 2; dir++) { struct uci_chan *uci_chan = (dir) ? Loading