From patchwork Fri Jan 11 17:41:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 10760427 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F1E641869 for ; Fri, 11 Jan 2019 17:41:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DDAEB2A1ED for ; Fri, 11 Jan 2019 17:41:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D22A52A1EE; Fri, 11 Jan 2019 17:41:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8A4F12A20F for ; Fri, 11 Jan 2019 17:41:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731680AbfAKRlu (ORCPT ); Fri, 11 Jan 2019 12:41:50 -0500 Received: from perceval.ideasonboard.com ([213.167.242.64]:33736 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730100AbfAKRlt (ORCPT ); Fri, 11 Jan 2019 12:41:49 -0500 Received: from localhost.localdomain (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id F0FCB565; Fri, 11 Jan 2019 18:41:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1547228507; bh=nvKuBswDQlnBtUKqkgbPKbQVp5dPgMNwIlh3wHRr9v4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=urw7i/yVMCJT8PgftNDUfhxOnWmgFSceKIT/OGwhD6+soAPcr8/9X5wuSqmvZb2JD ch7jCkRA0myTJU0kvLSbNm9WQ94+lfv3XPP189UHz4in0nA6E7sGVnTRZJtLlw5+hq rJtjvM93cmaRzSM7WgcStZVVkAiaonNQd5DNG3RA= From: Kieran Bingham To: Koji Matsuoka , Jacopo Mondi , Laurent Pinchart , =?utf-8?q?Niklas_S?= =?utf-8?q?=C3=B6derlund?= , Steve Longerbeam Cc: linux-renesas-soc@vger.kernel.org, linux-media@vger.kernel.org, Kieran Bingham Subject: [PATCH 2/2] media: i2c: adv748x: Remove PAGE_WAIT Date: Fri, 11 Jan 2019 17:41:41 +0000 Message-Id: <20190111174141.12594-3-kieran.bingham+renesas@ideasonboard.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190111174141.12594-1-kieran.bingham+renesas@ideasonboard.com> References: <20190111174141.12594-1-kieran.bingham+renesas@ideasonboard.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The ADV748X_PAGE_WAIT is a fake page to insert arbitrary delays in the register tables. Its only usage was removed, so we can remove the handling and simplify the code. Signed-off-by: Kieran Bingham Reviewed-by: Laurent Pinchart Reviewed-by: Niklas Söderlund --- drivers/media/i2c/adv748x/adv748x-core.c | 17 ++++++----------- drivers/media/i2c/adv748x/adv748x.h | 1 - 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/media/i2c/adv748x/adv748x-core.c b/drivers/media/i2c/adv748x/adv748x-core.c index 252bdb28b18b..8199e0b20790 100644 --- a/drivers/media/i2c/adv748x/adv748x-core.c +++ b/drivers/media/i2c/adv748x/adv748x-core.c @@ -219,18 +219,13 @@ static int adv748x_write_regs(struct adv748x_state *state, int ret; while (regs->page != ADV748X_PAGE_EOR) { - if (regs->page == ADV748X_PAGE_WAIT) { - msleep(regs->value); - } else { - ret = adv748x_write(state, regs->page, regs->reg, - regs->value); - if (ret < 0) { - adv_err(state, - "Error regs page: 0x%02x reg: 0x%02x\n", - regs->page, regs->reg); - return ret; - } + ret = adv748x_write(state, regs->page, regs->reg, regs->value); + if (ret < 0) { + adv_err(state, "Error regs page: 0x%02x reg: 0x%02x\n", + regs->page, regs->reg); + return ret; } + regs++; } diff --git a/drivers/media/i2c/adv748x/adv748x.h b/drivers/media/i2c/adv748x/adv748x.h index 2f8d751cfbb0..5042f9e94aee 100644 --- a/drivers/media/i2c/adv748x/adv748x.h +++ b/drivers/media/i2c/adv748x/adv748x.h @@ -39,7 +39,6 @@ enum adv748x_page { ADV748X_PAGE_MAX, /* Fake pages for register sequences */ - ADV748X_PAGE_WAIT, /* Wait x msec */ ADV748X_PAGE_EOR, /* End Mark */ };