From: Jaehyoung Choi Date: Fri, 3 Aug 2018 03:14:50 +0000 (+0900) Subject: [COMMON] Fix CHUB, NFC build error X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=31809c4ef5d291b20300486676d9895ae4b50dcb;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [COMMON] Fix CHUB, NFC build error Change-Id: Id0243a801771368c17a7acb6d92a4525646f8658 Signed-off-by: Jaehyoung Choi --- diff --git a/drivers/nfc/samsung/sec_nfc.c b/drivers/nfc/samsung/sec_nfc.c index 61f527fc0415..ab737003f61d 100644 --- a/drivers/nfc/samsung/sec_nfc.c +++ b/drivers/nfc/samsung/sec_nfc.c @@ -622,7 +622,6 @@ static int sec_nfc_parse_dt(struct device *dev, struct sec_nfc_platform_data *pdata) { struct device_node *np = dev->of_node; - int ret; pdata->ven = of_get_named_gpio(np, "sec-nfc,ven-gpio", 0); pdata->firm = of_get_named_gpio(np, "sec-nfc,firm-gpio", 0); diff --git a/drivers/staging/nanohub/chub.c b/drivers/staging/nanohub/chub.c index 03493ff7f790..5ef1aecfdb56 100644 --- a/drivers/staging/nanohub/chub.c +++ b/drivers/staging/nanohub/chub.c @@ -382,10 +382,6 @@ static void handle_debug_work_func(struct work_struct *work) { struct contexthub_ipc_info *ipc = container_of(work, struct contexthub_ipc_info, debug_work); - enum ipc_debug_event event = 0; - enum chub_err_type err = 0; - bool need_reset = 0; - int ret; int i; mutex_lock(&dbg_mutex); @@ -406,7 +402,6 @@ int contexthub_ipc_read(struct contexthub_ipc_info *ipc, uint8_t *rx, int max_le unsigned long flag; int size = 0; int ret; - int lock; void *rxbuf; if (!contexthub_get_token(ipc, IPC_ACCESS)) { @@ -916,7 +911,6 @@ int contexthub_download_image(struct contexthub_ipc_info *ipc, enum ipc_region r { const struct firmware *entry; int ret; - char *name; if (reg == IPC_REG_BL) ret = request_firmware(&entry, "bl.unchecked.bin", ipc->dev); @@ -938,164 +932,8 @@ int contexthub_download_image(struct contexthub_ipc_info *ipc, enum ipc_region r return 0; } -int contexthub_download_bl(struct contexthub_ipc_info *ipc) -{ - int ret; - - ret = contexthub_ipc_write_event(ipc, MAILBOX_EVT_SHUTDOWN); - - if (!ret) - ret = contexthub_download_image(ipc, 1); - - if (!ret) - ret = contexthub_download_image(ipc, 0); - - if (!ret) - ret = contexthub_ipc_write_event(ipc, MAILBOX_EVT_RESET); - - return ret; -} - -int contexthub_download_kernel(struct contexthub_ipc_info *ipc) -{ - return contexthub_download_image(ipc, 0); -} - -#ifdef CONFIG_CONTEXTHUB_DEBUG -static void handle_utc_work_func(struct work_struct *work) -{ - struct contexthub_ipc_info *ipc = - container_of(work, struct contexthub_ipc_info, utc_work); - int trycnt = 0; - -#ifdef USE_TIME_SYNC - while (ipc->utc_run) { - msleep(20000); - ipc_write_val(AP, sched_clock()); - ipc_write_debug_event(AP, ipc->utc_run); - ipc_add_evt(IPC_EVT_A2C, IRQ_EVT_A2C_DEBUG); - if (!(++trycnt % 10)) - log_flush(ipc->fw_log); - }; -#endif - - dev_dbg(ipc->dev, "%s is done with %d try\n", __func__, trycnt); -} -#endif - -#define MAX_ERR_CNT (3) -/* handle errors of chub driver and fw */ -static void handle_debug_work_func(struct work_struct *work) -{ - struct contexthub_ipc_info *ipc = - container_of(work, struct contexthub_ipc_info, debug_work); - enum ipc_debug_event event = 0; - enum chub_err_type err = 0; - bool need_reset = 0; - bool alive = contexthub_lowlevel_alive(ipc); - int err = 0; -#ifdef CHUB_RESET_ENABLE - int ret; -#endif - int i; - - if (!alive || ipc->err_cnt[CHUB_ERR_NANOHUB_WDT]) { - need_reset = 1; - err = CHUB_ERR_NANOHUB_WDT; - goto do_err_handle; - } - - /* check chub fw error */ - event = ipc_read_debug_event(AP); - if (event) { - switch (event) { - case IPC_DEBUG_CHUB_FULL_LOG: - dev_warn(ipc->dev, - "Contexthub notified that logbuf is full\n"); - break; - case IPC_DEBUG_CHUB_PRINT_LOG: - log_flush(ipc->fw_log); - break; - case IPC_DEBUG_CHUB_FAULT: - dev_warn(ipc->dev, "Contexthub notified fault\n"); - err = CHUB_ERR_NANOHUB_FAULT; - break; - case IPC_DEBUG_CHUB_ASSERT: - dev_warn(ipc->dev, "Contexthub notified assert\n"); - err = CHUB_ERR_NANOHUB_ASSERT; - break; - case IPC_DEBUG_CHUB_ERROR: - dev_warn(ipc->dev, "Contexthub notified error\n"); - err = CHUB_ERR_NANOHUB_ERROR; - break; - default: - break; - } - - /* clear dbg event */ - dev_info(ipc->dev, "%s: dbg from chub:%d, err:%d\n", - __func__, event, err); - ipc_write_debug_event(AP, 0); - if (err) - ipc->err_cnt[err]++; - else - return; - } - -do_err_handle: - dev_info(ipc->dev, "%s: active_err:0x%x, alive:%d, dbg:%d\n", - __func__, ipc->active_err, alive, event); - - /* print error status */ - for (i = 0; i < CHUB_ERR_CHUB_MAX; i++) { - if (ipc->active_err & (1 << i)) { - dev_info(ipc->dev, "%s: err%d-%d, active_err:0x%x\n", - __func__, i, ipc->err_cnt[i], ipc->active_err); - ipc->active_err &= ~(1 << i); - err = i; - } - } - - /* print comms error status */ - for (i = CHUB_ERR_MAX + 1; i < CHUB_ERR_COMMS_MAX; i++) { - if (ipc->err_cnt[i]) - dev_info(ipc->dev, "%s: comms: err%d-%d\n", - __func__, i, ipc->err_cnt[i]); - } - - dev_info(ipc->dev, "%s: error:%d, alive:%d\n", - __func__, err, alive); - - /* dump hw & sram into file */ - chub_dbg_dump_hw(ipc, err); - if (need_reset) { -#ifdef CHUB_RESET_ENABLE - ret = contexthub_reset(ipc); - if (ret) - dev_warn(ipc->dev, "%s: fails to reset %d.\n", - __func__, ret); - else { - /* TODO: recovery */ - dev_info(ipc->dev, "%s: chub reset! should be recovery\n", - __func__); - if (CHUB_ERR_NANOHUB_WDT == CHUB_ERR_NANOHUB_WDT) - if (ipc->irq_wdt) - enable_irq(ipc->irq_wdt); - } -#else - atomic_set(&ipc->chub_status, CHUB_ST_HANG); -#endif - } else { - /* dump log into file: DO NOT logbuf dueto sram corruption */ - log_dump_all(err); - } -} - static void handle_irq(struct contexthub_ipc_info *ipc, enum irq_evt_chub evt) { -#ifndef USE_IPC_BUF - struct ipc_content *content; -#endif switch (evt) { case IRQ_EVT_C2A_DEBUG: request_debug_work(ipc, CHUB_ERR_NANOHUB, 1); diff --git a/drivers/staging/nanohub/chub_dbg.c b/drivers/staging/nanohub/chub_dbg.c index 1cd9585bac9e..5de0e889c430 100644 --- a/drivers/staging/nanohub/chub_dbg.c +++ b/drivers/staging/nanohub/chub_dbg.c @@ -135,7 +135,6 @@ void chub_dbg_dump_ram(struct contexthub_ipc_info *ipc, enum chub_err_type reaso static void chub_dbg_dump_status(struct contexthub_ipc_info *ipc) { - int val; int i; char *dbg_name[CHUB_ERR_MAX] = {"none", "evtq_empty", "read_fail", "write_fail", "evtq_no_hw_trigger", diff --git a/drivers/staging/nanohub/comms.c b/drivers/staging/nanohub/comms.c index ee73dcb6042a..f23389ab4f19 100644 --- a/drivers/staging/nanohub/comms.c +++ b/drivers/staging/nanohub/comms.c @@ -375,7 +375,6 @@ static int nanohub_comms_tx_rx(struct nanohub_data *data, uint32_t seq, uint8_t *rx, size_t rx_len) { int ret; - struct contexthub_ipc_info *ipc = data->pdata->mailbox_client; ret = data->comms.write(data, (uint8_t *)&pad->packet, packet_size, data->comms.timeout_write); @@ -416,7 +415,6 @@ int nanohub_comms_rx_retrans_boottime(struct nanohub_data *data, uint32_t cmd, uint32_t seq; struct timespec ts; s64 boottime; - struct contexthub_ipc_info *ipc = data->pdata->mailbox_client; if (pad == NULL) return ERROR_NACK;