Skip to content

Commit 2c4ffe2

Browse files
trsqrmchehab
authored andcommitted
[media] dw2102: combine su3000_state and s6x0_state into dw2102_state
Two separate state structs are defined for different devices inside the dw2102. Combine them, as both only contain one element. This will also make it easier to further cleanup the driver. Signed-off-by: Olli Salonen <[email protected]> Signed-off-by: Antti Palosaari <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent 67e6590 commit 2c4ffe2

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

drivers/media/usb/dvb-usb/dw2102.c

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,8 @@
112112
"Please see linux/Documentation/dvb/ for more details " \
113113
"on firmware-problems."
114114

115-
struct su3000_state {
115+
struct dw2102_state {
116116
u8 initialized;
117-
};
118-
119-
struct s6x0_state {
120117
int (*old_set_voltage)(struct dvb_frontend *f, fe_sec_voltage_t v);
121118
};
122119

@@ -887,7 +884,7 @@ static int su3000_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff)
887884

888885
static int su3000_power_ctrl(struct dvb_usb_device *d, int i)
889886
{
890-
struct su3000_state *state = (struct su3000_state *)d->priv;
887+
struct dw2102_state *state = (struct dw2102_state *)d->priv;
891888
u8 obuf[] = {0xde, 0};
892889

893890
info("%s: %d, initialized %d\n", __func__, i, state->initialized);
@@ -973,7 +970,7 @@ static int s660_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage)
973970
{
974971
struct dvb_usb_adapter *d =
975972
(struct dvb_usb_adapter *)(fe->dvb->priv);
976-
struct s6x0_state *st = (struct s6x0_state *)d->dev->priv;
973+
struct dw2102_state *st = (struct dw2102_state *)d->dev->priv;
977974

978975
dw210x_set_voltage(fe, voltage);
979976
if (st->old_set_voltage)
@@ -1295,7 +1292,7 @@ static int stv0288_frontend_attach(struct dvb_usb_adapter *d)
12951292

12961293
static int ds3000_frontend_attach(struct dvb_usb_adapter *d)
12971294
{
1298-
struct s6x0_state *st = (struct s6x0_state *)d->dev->priv;
1295+
struct dw2102_state *st = d->dev->priv;
12991296
u8 obuf[] = {7, 1};
13001297

13011298
d->fe_adap[0].fe = dvb_attach(ds3000_attach, &s660_ds3000_config,
@@ -1857,7 +1854,7 @@ static struct dvb_usb_device_properties dw3101_properties = {
18571854
static struct dvb_usb_device_properties s6x0_properties = {
18581855
.caps = DVB_USB_IS_AN_I2C_ADAPTER,
18591856
.usb_ctrl = DEVICE_SPECIFIC,
1860-
.size_of_priv = sizeof(struct s6x0_state),
1857+
.size_of_priv = sizeof(struct dw2102_state),
18611858
.firmware = S630_FIRMWARE,
18621859
.no_reconnect = 1,
18631860

@@ -1950,7 +1947,7 @@ static struct dvb_usb_device_description d632 = {
19501947
static struct dvb_usb_device_properties su3000_properties = {
19511948
.caps = DVB_USB_IS_AN_I2C_ADAPTER,
19521949
.usb_ctrl = DEVICE_SPECIFIC,
1953-
.size_of_priv = sizeof(struct su3000_state),
1950+
.size_of_priv = sizeof(struct dw2102_state),
19541951
.power_ctrl = su3000_power_ctrl,
19551952
.num_adapters = 1,
19561953
.identify_state = su3000_identify_state,
@@ -2015,7 +2012,7 @@ static struct dvb_usb_device_properties su3000_properties = {
20152012
static struct dvb_usb_device_properties t220_properties = {
20162013
.caps = DVB_USB_IS_AN_I2C_ADAPTER,
20172014
.usb_ctrl = DEVICE_SPECIFIC,
2018-
.size_of_priv = sizeof(struct su3000_state),
2015+
.size_of_priv = sizeof(struct dw2102_state),
20192016
.power_ctrl = su3000_power_ctrl,
20202017
.num_adapters = 1,
20212018
.identify_state = su3000_identify_state,

0 commit comments

Comments
 (0)