From 60b2db614ee5b511ae5d435bc21b7494d4a4a662 Mon Sep 17 00:00:00 2001 From: Patrik Jakobsson Date: Wed, 26 Oct 2016 16:57:23 +0200 Subject: [PATCH] fthd: Code style cleanups Signed-off-by: Patrik Jakobsson --- fthd_debugfs.c | 4 ++-- fthd_drv.c | 5 ++--- fthd_hw.c | 1 - fthd_v4l2.c | 4 ++-- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/fthd_debugfs.c b/fthd_debugfs.c index eeea8a3..96314ae 100644 --- a/fthd_debugfs.c +++ b/fthd_debugfs.c @@ -84,9 +84,9 @@ static ssize_t fthd_store_debug(struct file *file, const char __user *user_buf, opcode = CISP_CMD_DEBUG_GET_FSM_DEBUG_LEVEL; else if (sscanf(buf, "set_fsm_debug_level %x", &cmd.arg[0]) == 2) opcode = CISP_CMD_DEBUG_SET_FSM_DEBUG_LEVEL; - else if (sscanf(buf, "%i %i\n", &opcode, &cmd.arg[0]) != 2) return -EINVAL; + cmd.show_errors = 1; ret = fthd_isp_debug_cmd(dev_priv, opcode, &cmd, sizeof(cmd), NULL); @@ -104,7 +104,7 @@ static int seq_channel_read(struct seq_file *seq, struct fthd_private *dev_priv, u32 entry; spin_lock_irq(&chan->lock); - for( i = 0; i < chan->size; i++) { + for (i = 0; i < chan->size; i++) { if (chan->ringbuf.idx == i) pos = '*'; else diff --git a/fthd_drv.c b/fthd_drv.c index c46bd3b..deb6d10 100644 --- a/fthd_drv.c +++ b/fthd_drv.c @@ -320,7 +320,7 @@ static int fthd_pci_set_dma_mask(struct fthd_private *dev_priv, static void fthd_stop_firmware(struct fthd_private *dev_priv) { - fthd_isp_cmd_stop(dev_priv); + fthd_isp_cmd_stop(dev_priv); isp_powerdown(dev_priv); } @@ -369,7 +369,6 @@ static int fthd_pci_init(struct fthd_private *dev_priv) struct pci_dev *pdev = dev_priv->pdev; int ret; - ret = pci_enable_device(pdev); if (ret) { pr_err("Failed to enable device\n"); @@ -438,7 +437,6 @@ static int fthd_firmware_start(struct fthd_private *dev_priv) return ret; return fthd_isp_cmd_set_loadfile(dev_priv); - } static int fthd_pci_probe(struct pci_dev *pdev, @@ -492,6 +490,7 @@ static int fthd_pci_probe(struct pci_dev *pdev, if (ret) goto fail_v4l2; return 0; + fail_v4l2: fthd_v4l2_unregister(dev_priv); fail_firmware: diff --git a/fthd_hw.c b/fthd_hw.c index c364837..35e938e 100644 --- a/fthd_hw.c +++ b/fthd_hw.c @@ -158,7 +158,6 @@ static int fthd_hw_s2_pll_init(struct fthd_private *dev_priv, u32 ddr_speed) /* Ref clk 24 */ FTHD_S2_REG_WRITE(0x04b00000, S2_PLL_CTRL_20); FTHD_S2_REG_WRITE(0x14280904, S2_PLL_CTRL_24); - } } diff --git a/fthd_v4l2.c b/fthd_v4l2.c index 3000614..ac6c8f7 100644 --- a/fthd_v4l2.c +++ b/fthd_v4l2.c @@ -189,7 +189,7 @@ static int fthd_buffer_prepare(struct vb2_buffer *vb) ctx->plane[i] = fthd_iommu_alloc_sgtable(dev_priv, sgtable); - if(!ctx->plane[i]) + if (!ctx->plane[i]) return -ENOMEM; } } @@ -279,7 +279,7 @@ static void fthd_stop_streaming(struct vb2_queue *vq) pr_debug("done\n"); } else { /* Firmware doesn't respond. */ - for (i = 0; i < FTHD_NUM_BUFS;i++) { + for (i = 0; i < FTHD_NUM_BUFS; i++) { ctx = dev_priv->h2t_bufs + i; if (ctx->state == BUF_DRV_QUEUED || ctx->state == BUF_HW_QUEUED) {