From patchwork Sun Feb 8 20:55:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis de Bethencourt X-Patchwork-Id: 5797921 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id EDF7ABF440 for ; Sun, 8 Feb 2015 20:56:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 347FC2020F for ; Sun, 8 Feb 2015 20:56:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4F206201FA for ; Sun, 8 Feb 2015 20:55:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753581AbbBHUzl (ORCPT ); Sun, 8 Feb 2015 15:55:41 -0500 Received: from mail-we0-f169.google.com ([74.125.82.169]:58934 "EHLO mail-we0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752724AbbBHUzk (ORCPT ); Sun, 8 Feb 2015 15:55:40 -0500 Received: by mail-we0-f169.google.com with SMTP id k48so2274576wev.0; Sun, 08 Feb 2015 12:55:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:date:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=00e61OVhFOnCljA/lRaQKdzn4YQ8ZOBmLBGHehNPWxI=; b=vyUoD5me03fwtB/02RL9LXaIl91nn4x9i0kGtrJaGCAsvuqB4VZAYxtqoV2aM9Vs/z E2mt1TIWuJEj0AYnxXJB+pOw88uOszSfVoPPIJsemXfrKAsq5Vxdns7tQbNo/Kowurd1 xNUqdnNrXHXHwt1lueeZ6gZXSVZcGfZgLp3IHyB6sgDxyf6fY+ZwZIApP7NmAaQO0XwE 46U2/ZyUdgM+SI1XjItCBXj0Qcky2dyjOmO2Aggr6DaL0kqPmt3UvoUrQz8siJlGuUo8 HV+qzQXqzCH0nQNuZ/7UqeZx5y0AHXXnDVHZ5r2+/nqT+4GbYbhgHp7N5JIKce3FbXPE Bedw== X-Received: by 10.195.17.137 with SMTP id ge9mr34514555wjd.44.1423428939105; Sun, 08 Feb 2015 12:55:39 -0800 (PST) Received: from localhost (cpc9-slam5-2-0-cust824.2-4.cable.virginm.net. [81.108.163.57]) by mx.google.com with ESMTPSA id vq9sm13449970wjc.6.2015.02.08.12.55.37 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 08 Feb 2015 12:55:38 -0800 (PST) From: luisbg X-Google-Original-From: luisbg Date: Sun, 8 Feb 2015 20:55:36 +0000 To: linux-media@vger.kernel.org Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, mchehab@osg.samsung.com, gregkh@linuxfoundation.org Subject: [PATCH] media: cxd2099: move pre-init values out of init() Message-ID: <20150208205536.GA31543@turing> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Improve code readability by moving out all pre-init values from the init function. Signed-off-by: Luis de Bethencourt --- drivers/staging/media/cxd2099/cxd2099.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/media/cxd2099/cxd2099.c b/drivers/staging/media/cxd2099/cxd2099.c index 657ea48..bafe36f 100644 --- a/drivers/staging/media/cxd2099/cxd2099.c +++ b/drivers/staging/media/cxd2099/cxd2099.c @@ -300,7 +300,6 @@ static int init(struct cxd *ci) int status; mutex_lock(&ci->lock); - ci->mode = -1; do { status = write_reg(ci, 0x00, 0x00); if (status < 0) @@ -420,7 +419,6 @@ static int init(struct cxd *ci) status = write_regm(ci, 0x09, 0x08, 0x08); if (status < 0) break; - ci->cammode = -1; cam_mode(ci, 0); } while (0); mutex_unlock(&ci->lock); @@ -711,6 +709,8 @@ struct dvb_ca_en50221 *cxd2099_attach(struct cxd2099_cfg *cfg, ci->en = en_templ; ci->en.data = ci; + ci->mode = -1; + ci->cammode = -1; init(ci); dev_info(&i2c->dev, "Attached CXD2099AR at %02x\n", ci->cfg.adr); return &ci->en;