diff options
author | Max Kellermann <max.kellermann@gmail.com> | 2016-08-10 00:32:26 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-11-18 20:05:44 +0300 |
commit | 22a613e89825ea7a3984a968463cc6d425bd8856 (patch) | |
tree | ec1841642bf43f88cf9b89323315dfca7418d0d6 /drivers/media/dvb-frontends | |
parent | 4d5030b69bb4880a760406a6d3d519f02b9351dc (diff) | |
download | linux-22a613e89825ea7a3984a968463cc6d425bd8856.tar.xz |
[media] dvb_frontend: merge duplicate dvb_tuner_ops.release implementations
Most release callback functions are identical: free the "tuner_priv"
and clear it. Let's eliminate some bloat by providing this simple
implementation in the dvb_frontend library.
Signed-off-by: Max Kellermann <max.kellermann@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/dvb-frontends')
-rw-r--r-- | drivers/media/dvb-frontends/dib0070.c | 9 | ||||
-rw-r--r-- | drivers/media/dvb-frontends/dib0090.c | 11 | ||||
-rw-r--r-- | drivers/media/dvb-frontends/dvb-pll.c | 9 | ||||
-rw-r--r-- | drivers/media/dvb-frontends/itd1000.c | 9 | ||||
-rw-r--r-- | drivers/media/dvb-frontends/ix2505v.c | 12 | ||||
-rw-r--r-- | drivers/media/dvb-frontends/stb6000.c | 9 | ||||
-rw-r--r-- | drivers/media/dvb-frontends/stb6100.c | 14 | ||||
-rw-r--r-- | drivers/media/dvb-frontends/stv6110.c | 9 | ||||
-rw-r--r-- | drivers/media/dvb-frontends/stv6110x.c | 12 | ||||
-rw-r--r-- | drivers/media/dvb-frontends/tda18271c2dd.c | 10 | ||||
-rw-r--r-- | drivers/media/dvb-frontends/tda665x.c | 11 | ||||
-rw-r--r-- | drivers/media/dvb-frontends/tda8261.c | 11 | ||||
-rw-r--r-- | drivers/media/dvb-frontends/tda826x.c | 9 | ||||
-rw-r--r-- | drivers/media/dvb-frontends/tua6100.c | 9 | ||||
-rw-r--r-- | drivers/media/dvb-frontends/zl10036.c | 12 |
15 files changed, 16 insertions, 140 deletions
diff --git a/drivers/media/dvb-frontends/dib0070.c b/drivers/media/dvb-frontends/dib0070.c index 016ad09a8754..d9f1bc2f778c 100644 --- a/drivers/media/dvb-frontends/dib0070.c +++ b/drivers/media/dvb-frontends/dib0070.c @@ -722,13 +722,6 @@ static int dib0070_get_frequency(struct dvb_frontend *fe, u32 *frequency) return 0; } -static int dib0070_release(struct dvb_frontend *fe) -{ - kfree(fe->tuner_priv); - fe->tuner_priv = NULL; - return 0; -} - static const struct dvb_tuner_ops dib0070_ops = { .info = { .name = "DiBcom DiB0070", @@ -736,7 +729,7 @@ static const struct dvb_tuner_ops dib0070_ops = { .frequency_max = 860000000, .frequency_step = 1000, }, - .release = dib0070_release, + .release = dvb_tuner_simple_release, .init = dib0070_wakeup, .sleep = dib0070_sleep, diff --git a/drivers/media/dvb-frontends/dib0090.c b/drivers/media/dvb-frontends/dib0090.c index 16200582f089..7b4bee5c8e34 100644 --- a/drivers/media/dvb-frontends/dib0090.c +++ b/drivers/media/dvb-frontends/dib0090.c @@ -2526,13 +2526,6 @@ static int dib0090_tune(struct dvb_frontend *fe) return ret; } -static int dib0090_release(struct dvb_frontend *fe) -{ - kfree(fe->tuner_priv); - fe->tuner_priv = NULL; - return 0; -} - enum frontend_tune_state dib0090_get_tune_state(struct dvb_frontend *fe) { struct dib0090_state *state = fe->tuner_priv; @@ -2594,7 +2587,7 @@ static const struct dvb_tuner_ops dib0090_ops = { .frequency_max = 860000000, .frequency_step = 1000, }, - .release = dib0090_release, + .release = dvb_tuner_simple_release, .init = dib0090_wakeup, .sleep = dib0090_sleep, @@ -2609,7 +2602,7 @@ static const struct dvb_tuner_ops dib0090_fw_ops = { .frequency_max = 860000000, .frequency_step = 1000, }, - .release = dib0090_release, + .release = dvb_tuner_simple_release, .init = NULL, .sleep = NULL, diff --git a/drivers/media/dvb-frontends/dvb-pll.c b/drivers/media/dvb-frontends/dvb-pll.c index b6d199196b83..56832d6f47ae 100644 --- a/drivers/media/dvb-frontends/dvb-pll.c +++ b/drivers/media/dvb-frontends/dvb-pll.c @@ -606,13 +606,6 @@ static int dvb_pll_configure(struct dvb_frontend *fe, u8 *buf, return (div * desc->entries[i].stepsize) - desc->iffreq; } -static int dvb_pll_release(struct dvb_frontend *fe) -{ - kfree(fe->tuner_priv); - fe->tuner_priv = NULL; - return 0; -} - static int dvb_pll_sleep(struct dvb_frontend *fe) { struct dvb_pll_priv *priv = fe->tuner_priv; @@ -745,7 +738,7 @@ static int dvb_pll_init(struct dvb_frontend *fe) } static const struct dvb_tuner_ops dvb_pll_tuner_ops = { - .release = dvb_pll_release, + .release = dvb_tuner_simple_release, .sleep = dvb_pll_sleep, .init = dvb_pll_init, .set_params = dvb_pll_set_params, diff --git a/drivers/media/dvb-frontends/itd1000.c b/drivers/media/dvb-frontends/itd1000.c index cadcae4cff89..d09f718f8119 100644 --- a/drivers/media/dvb-frontends/itd1000.c +++ b/drivers/media/dvb-frontends/itd1000.c @@ -348,13 +348,6 @@ static int itd1000_sleep(struct dvb_frontend *fe) return 0; } -static int itd1000_release(struct dvb_frontend *fe) -{ - kfree(fe->tuner_priv); - fe->tuner_priv = NULL; - return 0; -} - static const struct dvb_tuner_ops itd1000_tuner_ops = { .info = { .name = "Integrant ITD1000", @@ -363,7 +356,7 @@ static const struct dvb_tuner_ops itd1000_tuner_ops = { .frequency_step = 125, /* kHz for QPSK frontends */ }, - .release = itd1000_release, + .release = dvb_tuner_simple_release, .init = itd1000_init, .sleep = itd1000_sleep, diff --git a/drivers/media/dvb-frontends/ix2505v.c b/drivers/media/dvb-frontends/ix2505v.c index 2826bbb36b73..7742a7a8cdbb 100644 --- a/drivers/media/dvb-frontends/ix2505v.c +++ b/drivers/media/dvb-frontends/ix2505v.c @@ -94,16 +94,6 @@ static int ix2505v_write(struct ix2505v_state *state, u8 buf[], u8 count) return 0; } -static int ix2505v_release(struct dvb_frontend *fe) -{ - struct ix2505v_state *state = fe->tuner_priv; - - fe->tuner_priv = NULL; - kfree(state); - - return 0; -} - /** * Data write format of the Sharp IX2505V B0017 * @@ -264,7 +254,7 @@ static const struct dvb_tuner_ops ix2505v_tuner_ops = { .frequency_min = 950000, .frequency_max = 2175000 }, - .release = ix2505v_release, + .release = dvb_tuner_simple_release, .set_params = ix2505v_set_params, .get_frequency = ix2505v_get_frequency, }; diff --git a/drivers/media/dvb-frontends/stb6000.c b/drivers/media/dvb-frontends/stb6000.c index 73347d51f340..5252d485439e 100644 --- a/drivers/media/dvb-frontends/stb6000.c +++ b/drivers/media/dvb-frontends/stb6000.c @@ -41,13 +41,6 @@ struct stb6000_priv { u32 frequency; }; -static int stb6000_release(struct dvb_frontend *fe) -{ - kfree(fe->tuner_priv); - fe->tuner_priv = NULL; - return 0; -} - static int stb6000_sleep(struct dvb_frontend *fe) { struct stb6000_priv *priv = fe->tuner_priv; @@ -192,7 +185,7 @@ static const struct dvb_tuner_ops stb6000_tuner_ops = { .frequency_min = 950000, .frequency_max = 2150000 }, - .release = stb6000_release, + .release = dvb_tuner_simple_release, .sleep = stb6000_sleep, .set_params = stb6000_set_params, .get_frequency = stb6000_get_frequency, diff --git a/drivers/media/dvb-frontends/stb6100.c b/drivers/media/dvb-frontends/stb6100.c index 5add1182c3ca..befd26bdfa0f 100644 --- a/drivers/media/dvb-frontends/stb6100.c +++ b/drivers/media/dvb-frontends/stb6100.c @@ -61,8 +61,6 @@ struct stb6100_lkup { u8 reg; }; -static int stb6100_release(struct dvb_frontend *fe); - static const struct stb6100_lkup lkup[] = { { 0, 950000, 0x0a }, { 950000, 1000000, 0x0a }, @@ -536,7 +534,7 @@ static const struct dvb_tuner_ops stb6100_ops = { .set_params = stb6100_set_params, .get_frequency = stb6100_get_frequency, .get_bandwidth = stb6100_get_bandwidth, - .release = stb6100_release + .release = dvb_tuner_simple_release }; struct dvb_frontend *stb6100_attach(struct dvb_frontend *fe, @@ -560,16 +558,6 @@ struct dvb_frontend *stb6100_attach(struct dvb_frontend *fe, return fe; } -static int stb6100_release(struct dvb_frontend *fe) -{ - struct stb6100_state *state = fe->tuner_priv; - - fe->tuner_priv = NULL; - kfree(state); - - return 0; -} - EXPORT_SYMBOL(stb6100_attach); MODULE_PARM_DESC(verbose, "Set Verbosity level"); diff --git a/drivers/media/dvb-frontends/stv6110.c b/drivers/media/dvb-frontends/stv6110.c index 66a5a7f2295c..d9a88adc4c10 100644 --- a/drivers/media/dvb-frontends/stv6110.c +++ b/drivers/media/dvb-frontends/stv6110.c @@ -59,13 +59,6 @@ static s32 abssub(s32 a, s32 b) return b - a; }; -static int stv6110_release(struct dvb_frontend *fe) -{ - kfree(fe->tuner_priv); - fe->tuner_priv = NULL; - return 0; -} - static int stv6110_write_regs(struct dvb_frontend *fe, u8 buf[], int start, int len) { @@ -390,7 +383,7 @@ static const struct dvb_tuner_ops stv6110_tuner_ops = { .frequency_step = 1000, }, .init = stv6110_init, - .release = stv6110_release, + .release = dvb_tuner_simple_release, .sleep = stv6110_sleep, .set_params = stv6110_set_params, .get_frequency = stv6110_get_frequency, diff --git a/drivers/media/dvb-frontends/stv6110x.c b/drivers/media/dvb-frontends/stv6110x.c index c611ad210b5c..70d5641453c2 100644 --- a/drivers/media/dvb-frontends/stv6110x.c +++ b/drivers/media/dvb-frontends/stv6110x.c @@ -335,16 +335,6 @@ static int stv6110x_get_status(struct dvb_frontend *fe, u32 *status) } -static int stv6110x_release(struct dvb_frontend *fe) -{ - struct stv6110x_state *stv6110x = fe->tuner_priv; - - fe->tuner_priv = NULL; - kfree(stv6110x); - - return 0; -} - static const struct dvb_tuner_ops stv6110x_ops = { .info = { .name = "STV6110(A) Silicon Tuner", @@ -352,7 +342,7 @@ static const struct dvb_tuner_ops stv6110x_ops = { .frequency_max = 2150000, .frequency_step = 0, }, - .release = stv6110x_release + .release = dvb_tuner_simple_release, }; static const struct stv6110x_devctl stv6110x_ctl = { diff --git a/drivers/media/dvb-frontends/tda18271c2dd.c b/drivers/media/dvb-frontends/tda18271c2dd.c index bc247f9b553a..a324f30f7224 100644 --- a/drivers/media/dvb-frontends/tda18271c2dd.c +++ b/drivers/media/dvb-frontends/tda18271c2dd.c @@ -1126,14 +1126,6 @@ static int init(struct dvb_frontend *fe) return 0; } -static int release(struct dvb_frontend *fe) -{ - kfree(fe->tuner_priv); - fe->tuner_priv = NULL; - return 0; -} - - static int set_params(struct dvb_frontend *fe) { struct tda_state *state = fe->tuner_priv; @@ -1227,7 +1219,7 @@ static const struct dvb_tuner_ops tuner_ops = { .init = init, .sleep = sleep, .set_params = set_params, - .release = release, + .release = dvb_tuner_simple_release, .get_if_frequency = get_if_frequency, .get_bandwidth = get_bandwidth, }; diff --git a/drivers/media/dvb-frontends/tda665x.c b/drivers/media/dvb-frontends/tda665x.c index 7ca965987f40..39a1eb23ad04 100644 --- a/drivers/media/dvb-frontends/tda665x.c +++ b/drivers/media/dvb-frontends/tda665x.c @@ -197,20 +197,11 @@ static int tda665x_set_params(struct dvb_frontend *fe) return 0; } -static int tda665x_release(struct dvb_frontend *fe) -{ - struct tda665x_state *state = fe->tuner_priv; - - fe->tuner_priv = NULL; - kfree(state); - return 0; -} - static const struct dvb_tuner_ops tda665x_ops = { .get_status = tda665x_get_status, .set_params = tda665x_set_params, .get_frequency = tda665x_get_frequency, - .release = tda665x_release + .release = dvb_tuner_simple_release, }; struct dvb_frontend *tda665x_attach(struct dvb_frontend *fe, diff --git a/drivers/media/dvb-frontends/tda8261.c b/drivers/media/dvb-frontends/tda8261.c index e0df93191b9e..65f729ff27a9 100644 --- a/drivers/media/dvb-frontends/tda8261.c +++ b/drivers/media/dvb-frontends/tda8261.c @@ -152,15 +152,6 @@ static int tda8261_set_params(struct dvb_frontend *fe) return 0; } -static int tda8261_release(struct dvb_frontend *fe) -{ - struct tda8261_state *state = fe->tuner_priv; - - fe->tuner_priv = NULL; - kfree(state); - return 0; -} - static const struct dvb_tuner_ops tda8261_ops = { .info = { @@ -173,7 +164,7 @@ static const struct dvb_tuner_ops tda8261_ops = { .set_params = tda8261_set_params, .get_frequency = tda8261_get_frequency, .get_status = tda8261_get_status, - .release = tda8261_release + .release = dvb_tuner_simple_release, }; struct dvb_frontend *tda8261_attach(struct dvb_frontend *fe, diff --git a/drivers/media/dvb-frontends/tda826x.c b/drivers/media/dvb-frontends/tda826x.c index 2ec671df1441..bf8946c2c04a 100644 --- a/drivers/media/dvb-frontends/tda826x.c +++ b/drivers/media/dvb-frontends/tda826x.c @@ -41,13 +41,6 @@ struct tda826x_priv { u32 frequency; }; -static int tda826x_release(struct dvb_frontend *fe) -{ - kfree(fe->tuner_priv); - fe->tuner_priv = NULL; - return 0; -} - static int tda826x_sleep(struct dvb_frontend *fe) { struct tda826x_priv *priv = fe->tuner_priv; @@ -135,7 +128,7 @@ static const struct dvb_tuner_ops tda826x_tuner_ops = { .frequency_min = 950000, .frequency_max = 2175000 }, - .release = tda826x_release, + .release = dvb_tuner_simple_release, .sleep = tda826x_sleep, .set_params = tda826x_set_params, .get_frequency = tda826x_get_frequency, diff --git a/drivers/media/dvb-frontends/tua6100.c b/drivers/media/dvb-frontends/tua6100.c index 6da12b9e55eb..9e9a8ad7f37c 100644 --- a/drivers/media/dvb-frontends/tua6100.c +++ b/drivers/media/dvb-frontends/tua6100.c @@ -42,13 +42,6 @@ struct tua6100_priv { u32 frequency; }; -static int tua6100_release(struct dvb_frontend *fe) -{ - kfree(fe->tuner_priv); - fe->tuner_priv = NULL; - return 0; -} - static int tua6100_sleep(struct dvb_frontend *fe) { struct tua6100_priv *priv = fe->tuner_priv; @@ -164,7 +157,7 @@ static const struct dvb_tuner_ops tua6100_tuner_ops = { .frequency_max = 2150000, .frequency_step = 1000, }, - .release = tua6100_release, + .release = dvb_tuner_simple_release, .sleep = tua6100_sleep, .set_params = tua6100_set_params, .get_frequency = tua6100_get_frequency, diff --git a/drivers/media/dvb-frontends/zl10036.c b/drivers/media/dvb-frontends/zl10036.c index df5d0fe24687..0116557c0f10 100644 --- a/drivers/media/dvb-frontends/zl10036.c +++ b/drivers/media/dvb-frontends/zl10036.c @@ -134,16 +134,6 @@ static int zl10036_write(struct zl10036_state *state, u8 buf[], u8 count) return 0; } -static int zl10036_release(struct dvb_frontend *fe) -{ - struct zl10036_state *state = fe->tuner_priv; - - fe->tuner_priv = NULL; - kfree(state); - - return 0; -} - static int zl10036_sleep(struct dvb_frontend *fe) { struct zl10036_state *state = fe->tuner_priv; @@ -453,7 +443,7 @@ static const struct dvb_tuner_ops zl10036_tuner_ops = { .frequency_max = 2175000 }, .init = zl10036_init, - .release = zl10036_release, + .release = dvb_tuner_simple_release, .sleep = zl10036_sleep, .set_params = zl10036_set_params, .get_frequency = zl10036_get_frequency, |