From patchwork Thu May 16 01:14:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 10945505 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 983AD912 for ; Thu, 16 May 2019 01:48:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 89EB42874A for ; Thu, 16 May 2019 01:48:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7DB45288AD; Thu, 16 May 2019 01:48:47 +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=-7.9 required=2.0 tests=BAYES_00,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 34C882874A for ; Thu, 16 May 2019 01:48:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727452AbfEPBqa (ORCPT ); Wed, 15 May 2019 21:46:30 -0400 Received: from vsp-unauthed02.binero.net ([195.74.38.227]:22613 "EHLO vsp-unauthed02.binero.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726953AbfEPBPQ (ORCPT ); Wed, 15 May 2019 21:15:16 -0400 X-Halon-ID: 0d90662a-7778-11e9-8ab4-005056917a89 Authorized-sender: niklas@soderlund.pp.se Received: from bismarck.berto.se (unknown [89.233.230.99]) by bin-vsp-out-01.atm.binero.net (Halon) with ESMTPA id 0d90662a-7778-11e9-8ab4-005056917a89; Thu, 16 May 2019 03:15:12 +0200 (CEST) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: Laurent Pinchart , Ulrich Hecht , linux-media@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, =?utf-8?q?Niklas_S=C3=B6derlund?= , Ulrich Hecht Subject: [PATCH v2 7/8] rcar-vin: Fold rvin_initialize_device() into rvin_open() Date: Thu, 16 May 2019 03:14:16 +0200 Message-Id: <20190516011417.10590-8-niklas.soderlund+renesas@ragnatech.se> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190516011417.10590-1-niklas.soderlund+renesas@ragnatech.se> References: <20190516011417.10590-1-niklas.soderlund+renesas@ragnatech.se> MIME-Version: 1.0 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 function no longer serve a purpose as most tasks it performed have been refactored, fold what remains of it into the only caller. Signed-off-by: Niklas Söderlund Reviewed-by: Ulrich Hecht --- 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 7c8ba4b310706ceb..169639416121f204 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, bool 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, true); - 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, true); + if (ret < 0) goto err_open; - } + + v4l2_ctrl_handler_setup(&vin->ctrl_handler); } mutex_unlock(&vin->lock);