[COMMON] Fix CHUB, NFC build error
authorJaehyoung Choi <jkkkkk.choi@samsung.com>
Fri, 3 Aug 2018 03:14:50 +0000 (12:14 +0900)
committerCosmin Tanislav <demonsingur@gmail.com>
Mon, 22 Apr 2024 17:22:55 +0000 (20:22 +0300)
Change-Id: Id0243a801771368c17a7acb6d92a4525646f8658
Signed-off-by: Jaehyoung Choi <jkkkkk.choi@samsung.com>
drivers/nfc/samsung/sec_nfc.c
drivers/staging/nanohub/chub.c
drivers/staging/nanohub/chub_dbg.c
drivers/staging/nanohub/comms.c

index 61f527fc04155c2abfc9ae742c0d67bca8a77647..ab737003f61dcc23de6010b31b498b822d3344a3 100644 (file)
@@ -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);
index 03493ff7f790384d5ddbbc3bd46d0d3ee7438bf3..5ef1aecfdb564258c4d1ad60350084206acb403b 100644 (file)
@@ -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);
index 1cd9585bac9e66ebec9ba096f304ff34519c8626..5de0e889c430fce2b17423b496ae7aa2edc4059d 100644 (file)
@@ -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",
index ee73dcb6042ac20ccd0e705875b1f709987aa142..f23389ab4f19d3c8a1a7b72ad9b0cca74d8bc9e3 100644 (file)
@@ -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;