All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	linux-media@vger.kernel.org
Cc: linux-renesas-soc@vger.kernel.org,
	"Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>
Subject: [PATCH 7/8] rcar-vin: Fold rvin_initialize_device() into rvin_open()
Date: Sat, 13 Apr 2019 01:43:58 +0200	[thread overview]
Message-ID: <20190412234359.5079-8-niklas.soderlund+renesas@ragnatech.se> (raw)
In-Reply-To: <20190412234359.5079-1-niklas.soderlund+renesas@ragnatech.se>

The function no longer serve a purpose as most tasks it performed have
been refactored, fold what remains it into the only caller.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
---
 drivers/media/platform/rcar-vin/rcar-v4l2.c | 21 ++++-----------------
 1 file changed, 4 insertions(+), 17 deletions(-)

diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c b/drivers/media/platform/rcar-vin/rcar-v4l2.c
index 3b4624c117aaba18..58d0b59ee1247c8f 100644
--- a/drivers/media/platform/rcar-vin/rcar-v4l2.c
+++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c
@@ -762,20 +762,6 @@ static int rvin_power_parallel(struct rvin_dev *vin, int on)
 	return 0;
 }
 
-static int rvin_initialize_device(struct file *file)
-{
-	struct rvin_dev *vin = video_drvdata(file);
-	int ret;
-
-	ret = rvin_power_parallel(vin, 1);
-	if (ret < 0)
-		return ret;
-
-	v4l2_ctrl_handler_setup(&vin->ctrl_handler);
-
-	return 0;
-}
-
 static int rvin_open(struct file *file)
 {
 	struct rvin_dev *vin = video_drvdata(file);
@@ -796,10 +782,11 @@ static int rvin_open(struct file *file)
 		goto err_pm;
 
 	if (v4l2_fh_is_singular_file(file)) {
-		if (rvin_initialize_device(file)) {
-			ret = -ENODEV;
+		ret = rvin_power_parallel(vin, 1);
+		if (ret < 0)
 			goto err_open;
-		}
+
+		v4l2_ctrl_handler_setup(&vin->ctrl_handler);
 	}
 
 	mutex_unlock(&vin->lock);
-- 
2.21.0


  parent reply	other threads:[~2019-04-12 23:45 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-12 23:43 [PATCH 0/8] rcar-vin: Merge Gen2 and Gen3 file operations Niklas Söderlund
2019-04-12 23:43 ` [PATCH 1/8] rcar-vin: Do not call pm_runtime_{resume,suspend}() Niklas Söderlund
2019-04-15 11:21   ` Ulrich Hecht
2019-04-12 23:43 ` [PATCH 2/8] rcar-vin: Remove unneeded calls to pm_runtime_{enable,disable} Niklas Söderlund
2019-04-13  9:06   ` Sergei Shtylyov
2019-04-15 11:21   ` Ulrich Hecht
2019-04-12 23:43 ` [PATCH 3/8] rcar-vin: Allow interrupting lock when trying to open the video device Niklas Söderlund
2019-04-15 11:21   ` Ulrich Hecht
2019-04-12 23:43 ` [PATCH 4/8] rcar-vin: Do not sync subdevice format when opening " Niklas Söderlund
2019-04-15 11:24   ` Ulrich Hecht
2019-04-12 23:43 ` [PATCH 5/8] rcar-vin: Move pm_runtime_{get,put} out of helpers Niklas Söderlund
2019-04-13  9:05   ` Sergei Shtylyov
2019-04-15 11:31   ` Ulrich Hecht
2019-04-12 23:43 ` [PATCH 6/8] rcar-vin: Merge helpers dealing with powering the parallel subdevice Niklas Söderlund
2019-04-15 11:59   ` Ulrich Hecht
2019-04-12 23:43 ` Niklas Söderlund [this message]
2019-04-13  9:08   ` [PATCH 7/8] rcar-vin: Fold rvin_initialize_device() into rvin_open() Sergei Shtylyov
2019-04-15 12:02   ` Ulrich Hecht
2019-04-12 23:43 ` [PATCH 8/8] rcar-vin: Merge Gen2 and Gen3 file operations Niklas Söderlund
2019-04-15 12:06   ` Ulrich Hecht

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=20190412234359.5079-8-niklas.soderlund+renesas@ragnatech.se \
    --to=niklas.soderlund+renesas@ragnatech.se \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.