-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path0075-cx24117-Use-a-pointer-to-config-instead-of-storing-i.patch
86 lines (77 loc) · 2.78 KB
/
0075-cx24117-Use-a-pointer-to-config-instead-of-storing-i.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
From 95e86f1464b952dc088e4b872191bb2ce75e64ca Mon Sep 17 00:00:00 2001
From: Luis Alves <[email protected]>
Date: Tue, 22 Jul 2014 22:52:18 +0100
Subject: [PATCH 075/618] cx24117: Use a pointer to config instead of storing
it.
---
drivers/media/dvb-frontends/cx24117.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/media/dvb-frontends/cx24117.c b/drivers/media/dvb-frontends/cx24117.c
index a6c3c9e..b91bb9b 100644
--- a/drivers/media/dvb-frontends/cx24117.c
+++ b/drivers/media/dvb-frontends/cx24117.c
@@ -195,7 +195,7 @@ struct cx24117_cmd {
/* common to both fe's */
struct cx24117_priv {
- u8 demod_address;
+ struct cx24117_config *cfg;
struct i2c_adapter *i2c;
u8 skip_fw_load;
struct mutex fe_lock;
@@ -269,7 +269,7 @@ static struct cx24117_modfec {
static int cx24117_writereg(struct cx24117_state *state, u8 reg, u8 data)
{
u8 buf[] = { reg, data };
- struct i2c_msg msg = { .addr = state->priv->demod_address,
+ struct i2c_msg msg = { .addr = state->priv->cfg->demod_address,
.flags = 0, .buf = buf, .len = 2 };
int ret;
@@ -301,7 +301,7 @@ static int cx24117_writecmd(struct cx24117_state *state,
buf[0] = CX24117_REG_COMMAND;
memcpy(&buf[1], cmd->args, cmd->len);
- msg.addr = state->priv->demod_address;
+ msg.addr = state->priv->cfg->demod_address;
msg.flags = 0;
msg.len = cmd->len+1;
msg.buf = buf;
@@ -320,9 +320,9 @@ static int cx24117_readreg(struct cx24117_state *state, u8 reg)
int ret;
u8 recv = 0;
struct i2c_msg msg[] = {
- { .addr = state->priv->demod_address, .flags = 0,
+ { .addr = state->priv->cfg->demod_address, .flags = 0,
.buf = ®, .len = 1 },
- { .addr = state->priv->demod_address, .flags = I2C_M_RD,
+ { .addr = state->priv->cfg->demod_address, .flags = I2C_M_RD,
.buf = &recv, .len = 1 }
};
@@ -345,9 +345,9 @@ static int cx24117_readregN(struct cx24117_state *state,
{
int ret;
struct i2c_msg msg[] = {
- { .addr = state->priv->demod_address, .flags = 0,
+ { .addr = state->priv->cfg->demod_address, .flags = 0,
.buf = ®, .len = 1 },
- { .addr = state->priv->demod_address, .flags = I2C_M_RD,
+ { .addr = state->priv->cfg->demod_address, .flags = I2C_M_RD,
.buf = buf, .len = len }
};
@@ -622,7 +622,7 @@ static int cx24117_load_firmware(struct dvb_frontend *fe,
memcpy(&buf[1], fw->data, fw->size);
/* prepare i2c message to send */
- msg.addr = state->priv->demod_address;
+ msg.addr = state->priv->cfg->demod_address;
msg.flags = 0;
msg.len = fw->size + 1;
msg.buf = buf;
@@ -1184,7 +1184,7 @@ struct dvb_frontend *cx24117_attach(const struct cx24117_config *config,
case 1:
/* new priv instance */
priv->i2c = i2c;
- priv->demod_address = config->demod_address;
+ priv->cfg = config;
mutex_init(&priv->fe_lock);
break;
default:
--
2.8.3