From: luisbg <luis@debethencourt.com>
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()
Date: Sun, 8 Feb 2015 20:55:36 +0000 [thread overview]
Message-ID: <20150208205536.GA31543@turing> (raw)
Improve code readability by moving out all pre-init values from the init
function.
Signed-off-by: Luis de Bethencourt <luis.bg@samsung.com>
---
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;
--
2.1.0
next reply other threads:[~2015-02-08 20:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-08 20:55 luisbg [this message]
2015-04-08 11:09 ` [PATCH] media: cxd2099: move pre-init values out of init() Mauro Carvalho Chehab
2015-04-08 12:35 ` Luis de Bethencourt
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=20150208205536.GA31543@turing \
--to=luis@debethencourt.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@osg.samsung.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