[PATCH] media: cxd2099: move pre-init values out of init()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Improve code readability by moving out all pre-init values from the init
function.

Signed-off-by: Luis de Bethencourt <luis.bg@xxxxxxxxxxx>
---
 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

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux