linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
To: "Koji Matsuoka" <koji.matsuoka.xm@renesas.com>,
	"Jacopo Mondi" <jacopo@jmondi.org>,
	"Laurent Pinchart" <laurent.pinchart@ideasonboard.com>,
	"Niklas Söderlund" <niklas.soderlund@ragnatech.se>,
	"Steve Longerbeam" <steve_longerbeam@mentor.com>
Cc: linux-renesas-soc@vger.kernel.org, linux-media@vger.kernel.org,
	Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Subject: [PATCH 2/2] media: i2c: adv748x: Remove PAGE_WAIT
Date: Fri, 11 Jan 2019 17:41:41 +0000	[thread overview]
Message-ID: <20190111174141.12594-3-kieran.bingham+renesas@ideasonboard.com> (raw)
In-Reply-To: <20190111174141.12594-1-kieran.bingham+renesas@ideasonboard.com>

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 <kieran.bingham+renesas@ideasonboard.com>
---
 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 */
 };
 
-- 
2.17.1


  parent reply	other threads:[~2019-01-11 17:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-11 17:41 [PATCH 0/2] media: i2c: adv748x: Refactor sw_reset handling Kieran Bingham
2019-01-11 17:41 ` [PATCH 1/2] media: i2c: adv748x: Convert SW reset routine to function Kieran Bingham
2019-01-11 20:15   ` Laurent Pinchart
2019-01-12 16:50     ` Kieran Bingham
2019-01-18 12:26       ` Laurent Pinchart
2019-01-14 14:43   ` Niklas Söderlund
2019-01-18 12:09   ` Hans Verkuil
2019-01-18 13:34     ` Kieran Bingham
2019-01-11 17:41 ` Kieran Bingham [this message]
2019-01-11 20:23   ` [PATCH 2/2] media: i2c: adv748x: Remove PAGE_WAIT Laurent Pinchart
2019-01-12 16:51     ` Kieran Bingham
2019-01-14 14:44   ` Niklas Söderlund

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190111174141.12594-3-kieran.bingham+renesas@ideasonboard.com \
    --to=kieran.bingham+renesas@ideasonboard.com \
    --cc=jacopo@jmondi.org \
    --cc=koji.matsuoka.xm@renesas.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=niklas.soderlund@ragnatech.se \
    --cc=steve_longerbeam@mentor.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).