All of lore.kernel.org
 help / color / mirror / Atom feed
From: Antti Palosaari <crope@iki.fi>
To: linux-media@vger.kernel.org
Cc: Antti Palosaari <crope@iki.fi>
Subject: [PATCH 5/6] m88ts2022: change parameter type of m88ts2022_cmd
Date: Fri, 22 Aug 2014 03:33:40 +0300	[thread overview]
Message-ID: <1408667621-12072-5-git-send-email-crope@iki.fi> (raw)
In-Reply-To: <1408667621-12072-1-git-send-email-crope@iki.fi>

It is driver internal function and does not need anything from
frontend structure. Due to that change parameter type to driver
state which is better for driver internal functions.

Also remove one unused variable from state itself.

Signed-off-by: Antti Palosaari <crope@iki.fi>
---
 drivers/media/tuners/m88ts2022.c      | 21 ++++++++++-----------
 drivers/media/tuners/m88ts2022_priv.h |  1 -
 2 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/drivers/media/tuners/m88ts2022.c b/drivers/media/tuners/m88ts2022.c
index 04d3979..90e1a35 100644
--- a/drivers/media/tuners/m88ts2022.c
+++ b/drivers/media/tuners/m88ts2022.c
@@ -18,10 +18,9 @@
 
 #include "m88ts2022_priv.h"
 
-static int m88ts2022_cmd(struct dvb_frontend *fe,
-		int op, int sleep, u8 reg, u8 mask, u8 val, u8 *reg_val)
+static int m88ts2022_cmd(struct m88ts2022 *s, int op, int sleep, u8 reg,
+		u8 mask, u8 val, u8 *reg_val)
 {
-	struct m88ts2022 *s = fe->tuner_priv;
 	int ret, i;
 	unsigned int utmp;
 	struct m88ts2022_reg_val reg_vals[] = {
@@ -124,7 +123,7 @@ static int m88ts2022_set_params(struct dvb_frontend *fe)
 			s->frequency_khz, s->frequency_khz - c->frequency,
 			f_vco_khz, pll_n, div_ref, div_out);
 
-	ret = m88ts2022_cmd(fe, 0x10, 5, 0x15, 0x40, 0x00, NULL);
+	ret = m88ts2022_cmd(s, 0x10, 5, 0x15, 0x40, 0x00, NULL);
 	if (ret)
 		goto err;
 
@@ -142,7 +141,7 @@ static int m88ts2022_set_params(struct dvb_frontend *fe)
 		if (ret)
 			goto err;
 
-		ret = m88ts2022_cmd(fe, 0x10, 5, 0x15, 0x40, 0x00, NULL);
+		ret = m88ts2022_cmd(s, 0x10, 5, 0x15, 0x40, 0x00, NULL);
 		if (ret)
 			goto err;
 	}
@@ -158,7 +157,7 @@ static int m88ts2022_set_params(struct dvb_frontend *fe)
 			goto err;
 	}
 
-	ret = m88ts2022_cmd(fe, 0x08, 5, 0x3c, 0xff, 0x00, NULL);
+	ret = m88ts2022_cmd(s, 0x08, 5, 0x3c, 0xff, 0x00, NULL);
 	if (ret)
 		goto err;
 
@@ -185,7 +184,7 @@ static int m88ts2022_set_params(struct dvb_frontend *fe)
 	if (ret)
 		goto err;
 
-	ret = m88ts2022_cmd(fe, 0x04, 2, 0x26, 0xff, 0x00, &u8tmp);
+	ret = m88ts2022_cmd(s, 0x04, 2, 0x26, 0xff, 0x00, &u8tmp);
 	if (ret)
 		goto err;
 
@@ -195,7 +194,7 @@ static int m88ts2022_set_params(struct dvb_frontend *fe)
 	if (ret)
 		goto err;
 
-	ret = m88ts2022_cmd(fe, 0x04, 2, 0x26, 0xff, 0x00, &u8tmp);
+	ret = m88ts2022_cmd(s, 0x04, 2, 0x26, 0xff, 0x00, &u8tmp);
 	if (ret)
 		goto err;
 
@@ -227,7 +226,7 @@ static int m88ts2022_set_params(struct dvb_frontend *fe)
 	if (ret)
 		goto err;
 
-	ret = m88ts2022_cmd(fe, 0x04, 2, 0x26, 0xff, 0x00, &u8tmp);
+	ret = m88ts2022_cmd(s, 0x04, 2, 0x26, 0xff, 0x00, &u8tmp);
 	if (ret)
 		goto err;
 
@@ -237,7 +236,7 @@ static int m88ts2022_set_params(struct dvb_frontend *fe)
 	if (ret)
 		goto err;
 
-	ret = m88ts2022_cmd(fe, 0x04, 2, 0x26, 0xff, 0x00, &u8tmp);
+	ret = m88ts2022_cmd(s, 0x04, 2, 0x26, 0xff, 0x00, &u8tmp);
 	if (ret)
 		goto err;
 
@@ -257,7 +256,7 @@ static int m88ts2022_set_params(struct dvb_frontend *fe)
 	if (ret)
 		goto err;
 
-	ret = m88ts2022_cmd(fe, 0x01, 20, 0x21, 0xff, 0x00, NULL);
+	ret = m88ts2022_cmd(s, 0x01, 20, 0x21, 0xff, 0x00, NULL);
 	if (ret)
 		goto err;
 err:
diff --git a/drivers/media/tuners/m88ts2022_priv.h b/drivers/media/tuners/m88ts2022_priv.h
index a67afe3..a0e22fa 100644
--- a/drivers/media/tuners/m88ts2022_priv.h
+++ b/drivers/media/tuners/m88ts2022_priv.h
@@ -24,7 +24,6 @@ struct m88ts2022 {
 	struct m88ts2022_config cfg;
 	struct i2c_client *client;
 	struct regmap *regmap;
-	struct dvb_frontend *fe;
 	u32 frequency_khz;
 };
 
-- 
http://palosaari.fi/


  parent reply	other threads:[~2014-08-22  0:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-22  0:33 [PATCH 1/6] m88ts2022: fix coding style issues Antti Palosaari
2014-08-22  0:33 ` [PATCH 2/6] m88ts2022: rename device state (priv => s) Antti Palosaari
2014-08-22  0:33 ` [PATCH 3/6] m88ts2022: clean up logging Antti Palosaari
2014-08-22  0:33 ` [PATCH 4/6] m88ts2022: convert to RegMap I2C API Antti Palosaari
2014-08-22  0:33 ` Antti Palosaari [this message]
2014-08-22  0:33 ` [PATCH 6/6] m88ds3103: change .set_voltage() implementation Antti Palosaari
2014-08-22  3:19 ` Nibble Max
2014-08-22 10:40   ` Antti Palosaari

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=1408667621-12072-5-git-send-email-crope@iki.fi \
    --to=crope@iki.fi \
    --cc=linux-media@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.